Skip to main content
jdaston
Known Participant
May 26, 2017
Question

Interpreting data returned from event completion

  • May 26, 2017
  • 1 reply
  • 268 views

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.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 26, 2017

use the code suggested by adobe:

var retStatus:URLLoader=URLLoader(event.target);