1 Reply Latest reply on May 2, 2007 11:17 AM by V__K__K

    Stopping/Pausing SWFLoader

    postaljohn20
      Is there a way to stop or pause a SWF loaded through an SWFLoader component?

      Thanks,

      John
        • 1. Re: Stopping/Pausing SWFLoader
          V__K__K
          Following sample code will embed "somesymbol" (movieclip symbol) of "somefile.swf" and this is declared as myClass. Loading this in "Image" component and using stopmc method I can able to pause & play the loaded movie clip. I hope the same will work for SWF Loader as well as embedding the whole swf file.

          ___________

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="800" height="600">
          <mx:Script>
          <![CDATA[
          [Embed(source="somefile.swf", symbol="somesymbol")]

          [Bindable]
          public var myClass:Class;

          public function stopmc():void {
          var mc:MovieClip = MovieClip(Q01.content)
          if (playstop.label == "Stop") {
          mc.stop();
          playstop.label = "Play";
          }
          else {
          mc.play();
          playstop.label = "Stop";
          }
          }

          ]]>
          </mx:Script>
          <mx:HBox>
          <mx:Button id="playstop" label="Stop" click="stopmc();"/>
          <mx:Image id="Q01" source="{myClass}"/>

          </mx:HBox>
          </mx:Application>
          _______

          Hope this helps.