Boris28
11-27-2008, 03:31 PM
Hello,
please help me with communication between flash CS3 (Actionscript 3) and PHP. .sfw and PHP script are on the same server. I need to send variables
from flash to php and get response from php back to flash in XML format. I need to know, if this code is good and right or if there is a better solution for solving this problem.
function CommunicationFlashPHP():void
{
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, dataLoaded);
var request:URLRequest = new URLRequest("http://PHPScript.php?what=question" + "&sid=" + _sid + "&actualLevel=" + _actualLevel);
loader.load(request);
}
function dataLoaded(evt:Event):void
{
var xmlResponse:XML = XML((evt.target as URLLoader).data);
trace(xmlResponse);
}
please help me with communication between flash CS3 (Actionscript 3) and PHP. .sfw and PHP script are on the same server. I need to send variables
from flash to php and get response from php back to flash in XML format. I need to know, if this code is good and right or if there is a better solution for solving this problem.
function CommunicationFlashPHP():void
{
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, dataLoaded);
var request:URLRequest = new URLRequest("http://PHPScript.php?what=question" + "&sid=" + _sid + "&actualLevel=" + _actualLevel);
loader.load(request);
}
function dataLoaded(evt:Event):void
{
var xmlResponse:XML = XML((evt.target as URLLoader).data);
trace(xmlResponse);
}