Hi all,
I'm currently making use of the PHPObject class, great solution by the way.
I am having problems writing the results to my .as file. The .as file is called on the opening frame of the movie. This is what it looks like:
#include "PHPObject.as"
tmp = new PHPObject();
tmp.setDefaultGatewayKey("camcim74"); // CHANGE THIS TO WHATEVER SECRET KEY YOU SET IN Gateway.php
tmp.setDefaultGatewayUrl("http://localhost/MaguraPaint/retrieve/Gateway.php"); // CHANGE THIS TO WHERE YOU PLACE Gateway.php
delete tmp;
myFoo = new PHPObject("cards"); // declare a new object and link it to a remote PHP class
// set up responder
myFoo.getcard_onResult = function(result) {
for (var i = 0; i < result.length; i++) {
// Loop through all values and do with them as you please
Author.text = result[i].Author;
Picture.text = result[i].Picture;
Country.text = result[i].Country;
sloeve = result[i].sloeve;
aloeve = result[i].aloeve;
currentRis = result[i].currentRis;
frucS = result[i].frucS;
frucA = result[i].frucA;
}
}
// invoke method
myFoo.getcard("rJ7WP605");
The php file cards.php looks like this:
<?
class cards {
function getcard($getcard) {
$getcard = 1;
$db_name = "flashkit";
$connection = @mysql_connect("localhost", "root", "camcim74") or die("Cound not connect to database");
mysql_select_db($db_name, $connection) or die("Count not select database");
$query = "SELECT * FROM paint WHERE No = $getcard";
$q_result = mysql_query($query);
// Instantiate array
$arrResultSet = array();
// Retrieve all resulting rows and push to $arrResultSet
while ($rows = mysql_fetch_assoc($q_result)) {
array_push($arrResultSet, $rows);
}
//array_push($arrResultSet, $Author);
return $arrResultSet;
}
}
?>
Everything works just fine except when i get the results for the 'sloeve' row in the database. The results for 'sloeve' look like this:
sloj0=new Array(25,311,9062912,100,100,100,0,'spray',32);
sloj1=new Array(26,311,9062912,100,100,100,0,'spray',33);
sloj2=new Array(28,311,9062912,100,100,100,0,'spray',34);
sloj3=new Array(31,311,9062912,100,100,100,0,'spray',35);
sloj4=new Array(38,312,9062912,100,100,100,0,'spray',36);
sloj5=new Array(41,312,9062912,100,100,100,0,'spray',37);
sloj6=new Array(45,312,9062912,100,100,100,0,'spray',38);
sloj7=new Array(49,312,9062912,100,100,100,0,'spray',39);
sloj8=new Array(52,312,9062912,100,100,100,0,'spray',40);
sloj9=new Array(56,312,9062912,100,100,100,0,'spray',41);
sloj10=new Array(59,312,9062912,100,100,100,0,'spray',42);
WHat i want to be able to do is echo/print these to the .as file. Is this possible? If so, what is the method for echoung it into the .as file?
Regards,
micmac