Copy link to clipboard
Copied
I am creating a form in AS3 that communicates with a php file. When the data is sent I am trying to determine what happens using the properties recorded in the completion event. This is my code:
function onSendComplete(event:Event):void
{
var retStatus:URLLoader = new URLLoader(event.target);
//var retVariables:URLVariables = new URLVariables(returnStatus.data);
trace(retStatus.data);
loader.removeEventListener(Event.COMPLETE, onSendComplete);
//if ( retVariables.sent == "OK")
//{
// gotoAndStop("acknowledge");
//}
//else
//{
// failMessage = retVariables.thereason;
// gotoAndStop("failure");
//}
}
I basically copied this from the Adobe Action Script 3.0 website on "Working with external data". The code example is:
private function completeHandler(event:Event):void
{
var loader2:URLLoader = URLLoader(event.target);
trace(loader2.data);
}
However, instead of being able to get any data, I get the following error:
Scene 1, Layer 'action', Frame 1, Line 88, Column 52 1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.net:URLRequest.
I am stuck, does anyone have any ideas?
Thank you.
Copy link to clipboard
Copied
use the code suggested by adobe:
var retStatus:URLLoader=URLLoader(event.target);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now