Add Event listener : Event : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » Event »

 

Add Event listener


 

package {
  import flash.display.*;
  import flash.net.*;
  import flash.events.*;

  public class Main extends Sprite {
    public function Main() {
      var urlLoader:URLLoader = new URLLoader(  );
      urlLoader.addEventListener(Event.COMPLETE,
                                 completeListenerA,
                                 false,
                                 0);
      urlLoader.addEventListener(Event.COMPLETE,
                                 completeListenerB,
                                 false,
                                 1);
      urlLoader.load(new URLRequest("someFile.txt"));
    }

    private function completeListenerA (e:Event):void {
      trace("Listener A: Load complete");
    }

    private function completeListenerB (e:Event):void {
      trace("Listener B: Load complete");
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» Event