1 Reply Latest reply on Jun 14, 2010 9:36 AM by kglad

    Unloading a loaded SWF file

    copall

      Hello All,

       

      I am using the following code to load a SWF file into a Flash animation. The SWF file is nothing more than a short flv video (10 seconds). Users have the option of clicking a "HOME" mc if they want to return to the main menu before the flv video is completely finished playing.

       

      var myLoader:Loader = new Loader ();

       

      function lipStop(event:MouseEvent):void {
      var myURL:URLRequest = new URLRequest ("lipStop.swf");
      myLoader.load(myURL);
      addChild(myLoader);
      }

      home_mc.addEventListener(MouseEvent.CLICK, home);

      function home (event:MouseEvent):void {
      removeChild(myLoader)
      gotoAndStop(1)
      }

       

       

      When I click the HOME mc the lipStop.swf disappears as I intend and the animation returns to frame 1, but somehow I can still hear the SWF file playing in the background. I tried the samething using a FLV playback component and the same thing happens: timeline returns to frame 1, the image diappears, but I can still hear the audio track in the background.

       

      Any suggestions?

       

      Thanks in advance.

       

      Chris