1 Reply Latest reply on Mar 26, 2012 10:55 AM by Ned Murphy

    External swf

    AlexanderKaran Level 1

      I hvae a slight problem and for the life of me cant figure out how to fix it

       

      I have button that take you to the next frame and when you or that frame the action script code loads and external swf that have sound playing through out it full play length.

      Now when i press any keyboard key to remove the swf file and return to the previous frame it does, however the sound keeps going.

       

      How do i fix it

       

      Here is the code on the frame the swf file plays

       

      var myLoader:Loader = new Loader();                    

      var url:URLRequest = new URLRequest("Movie1-FullVersion.swf");

      myLoader.load(url);                                    

      addChild(myLoader);                                    

       

       

       

      stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler);

       

       

      function fl_KeyboardDownHandler(event:KeyboardEvent):void

      {

       

                removeChild(myLoader);

       

       

      }

        • 1. Re: External swf
          Ned Murphy Adobe Community Professional & MVP

          You should try unloading the loaded file, when you removeChild, the loader remains, it just isn't in the display list....

           

          function fl_KeyboardDownHandler(event:KeyboardEvent):void

          {

               myLoader.unloadAndStop();        

               removeChild(myLoader);

          }

          1 person found this helpful