Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Interpreting data returned from event completion

Community Beginner ,
May 25, 2017 May 25, 2017

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.

TOPICS
ActionScript
233
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2017 May 26, 2017
LATEST

use the code suggested by adobe:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines