I am using the following code
news_txt.html = true;
#include "NetServices.as"
#include "NetDebug.as"
NetServices.setDefaultGatewayUrl("gateway.php")
var gatewayConnection = NetServices.createGatewayConnection()
service = gatewayConnection.getService("albums", this)
getNews_Result = function(rs){
cant = rs.getLength() //how many rows are in our recordset?
for(var i=0; i<cant; i++){
//Dynamic put base on stage and fetch data to it
this.news_txt.htmlText = rs.getItemAt(i).Comments
}
}
service.getNews()
to call in text from mysql
with the service albums, this service is calling in other text and datagrid options
<?php
class albums{
//change to match your needs
var $dbhost = "localhost";
var $dbname = "league";
var $dbuser = "*****";
var $dbpass = "*****";
function albums(){
$this->methodTable = array(
"getItems" => array(
"description" => "Returns step4 table",
"access" => "remote" // available values are private, public, remote
//"arguments" => array ("message")
),
"setItems" => array(
"description" => "Echoes the passed argument back to Flash (no need to set the return type)",
"access" => "remote", // available values are private, public, remote
"arguments" => array ("rs")
),
"getDad" => array(
"description" => "returns dad table",
"access" => "remote"
),
"getAdam" => array (
"description" => "returns adam table",
"access" => "remote"
),
"getNews" => array (
"description" => "returns news table",
"access" => "remote"
),
"getDate" => array (
"description" => "returns date table",
"access" => "remote"
)
);
// Initialize db connection
$this->conn = mysql_pconnect($this->dbhost, $this->dbuser, $this->dbpass);
mysql_select_db ($this->dbname);
}
function getItems(){
return mysql_query("SELECT * FROM `step4` ORDER BY `position` ASC LIMIT 0 , 30 ");
}
function getDad(){
return mysql_query ("select Comments from dad");
}
function getAdam (){
return mysql_query ("select Comments from adam");
}
function getNews (){
return mysql_query ("select Comments from news");
}
function getDate (){
return mysql_query ("select Comments from date");
}
function setItems($rs){
$error = false;
for($i=0; $i<sizeof($rs); $i++){
$result = mysql_query("replace into step4 values('".$rs[$i]['ID']."', '".$rs[$i]['team']."', '".$rs[$i]['position']."', '".$rs[$i]['played']."', '".$rs[$i]['won']."', '".$rs[$i]['drawn']."', '".$rs[$i]['lost']."', '".$rs[$i]['goaldiff']."', '".$rs[$i]['points']."','".$rs[$i]['GF']."','".$rs[$i]['GA']."')");
if(!result) $error = true;
}
if(!$error) return "Ok"; else return "Error";
}
}
?>
Net connection debugger says all ok !
but sometimes I will not get any of the text and sometimes I will, any ideas ?
authored on mac os 10.3 using AS1 components as AS2 will not install