7 Replies Latest reply on Feb 17, 2010 10:20 AM by jsd99

    SWFLoader.unloadAndStop() doesn't

    jsd99 Level 3

      Try this very simple Flex app:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
          <![CDATA[
              import mx.controls.SWFLoader;
              private var ytplayer:SWFLoader;
             
              private function startYT():void {
                  ytplayer = new SWFLoader();
                  ytplayer.y=50;
                  this.addChild(ytplayer);
                  ytplayer.load("http://www.youtube.com/v/ukcMIaCQC94");
              }
             
              private function stopYT():void {
                  ytplayer.unloadAndStop(true);
              }
          ]]>
      </mx:Script>
          <mx:HBox>
              <mx:Button label="Start" click="startYT()" />
              <mx:Button label="Stop" click="stopYT()" />
          </mx:HBox>
      </mx:Application>

       

       

      Click the Start button.  A youtube player appears.  Click play on it.  Now click the Stop button in the app.  The video disappears, but the audio continues to play in the background.  How do I get it to stop completely?