7 Replies Latest reply on Aug 29, 2011 6:32 AM by kglad

    HELP! How to load multiple swfs using the following code?

    [no name] :D 2011

      In actions for Frame 1:

       

      var myrequest:URLRequest=new URLRequest("A.swf");     
      var myloader:Loader=new Loader();
      myloader.load(myrequest);

      img1.addEventListener(MouseEvent.CLICK, clickButton);

      function clickButton(event:MouseEvent):void{               
          stage.addChild(myloader);
          }
         

       

      img1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

       

      function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void

      {

           gotoAndStop(13);

      }

       

      In action for Frame 13:   (img2 is another button)

       

       

      img2.addEventListener(MouseEvent.CLICK, unloadFunction);

       

      function unloadFunction(event:Event):void{

           stage.removeChild(myloader);

      }