1 Reply Latest reply on Apr 1, 2008 8:28 PM by levancho

    Create SWFLoader in actionscript

    Flex_TonyChiu
      How can I create a SWFLoader in actionscript?
      I found that SWFLoader is initialized inside MXML code in many samples
        • 1. Re: Create SWFLoader in actionscript
          levancho Level 3
          I have never used it, but this is how it should work :

          var myLoader : SWFLoader= new SWFLoader() ;
          // register all listeners that you want :
          myLoader .addEventListener(Event.COMPLETE, completeHandler);
          myLoader .addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
          myLoader .addEventListener(Event.INIT, initHandler);
          myLoader .addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
          myLoader .addEventListener(Event.OPEN, openHandler);
          myLoader .addEventListener(ProgressEvent.PROGRESS, progressHandler);
          myLoader .addEventListener(Event.UNLOAD, unLoadHandler);

          // call Load
          myLoader.load("path/to/myresource.swf);


          P.S you can also use Loader class to load swf, jpeg etc resources as well, (I am not sure what is internal difference between using SWFLoader vs Loader )