I am trying to retrieve mysql data using php(products.php) and return the data in xml format to ADobe flash as3; but i am getting following error.
Error opening URL 'http://localhost/Flash/player/products.php'
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://localhost/Flash/player/products.php at php_mysql3_as3_fla::MainTimeline/frame1()
Please any suggestion or help why flash is not identifying the http://localhost/Flash/player/products.php addres. i have WAMP installed; which works fine as i have many other php projects working here.
Thanks in advance for help and suggestion.
THe following is my php code
<?php
$link = mysql_connect("localhost","root","");
mysql_select_db("test");
$query = "select * from products";
$results = mysql_query($query);
echo '<?xml version="1.0" encoding="utf-8" ?>'." \n";
echo"<GALLERY>\n";
$cnt=0;
while($line=mysql_fetch_assoc($results))
{
echo '<IMAGE TITLE="'.$cnt.'">'.$line['product'].'</IMAGE>'." \n";
$cnt++;
}
echo "</GALLERY>\n";
mysql_close($link);
?>
the php file is located at c:\wamp\www\Flash\player\products.php
below is my AS3 flash code
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
//myLoader.load(new URLRequest("c:\\wamp\\www\\Flash\\player\\products2.xml"));
myLoader.load(new URLRequest("http://localhost/Flash/player/products.php"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(evt:Event):void {
myXML = new XML(evt.target.data);
for (var i:int = 0; i<myXML.*.length(); i++){
trace("My image number is " + (i+1) + ", it's title is " + myXML.IMAGE[i].@TITLE + " and it's URL is " + myXML.IMAGE[i]);
};
//trace("data: " + myLoader.data);;
}