8 Replies Latest reply on Jul 8, 2009 10:04 PM by Flex harUI

    Facing problem while unloading the SWF file in SWF Loader

    Sandeep Dash

      Facing problem with SWF Loader.

       

      Background:

       

      I've 4 SWF files (demo1.swf, demo1_skin.swf, demo2.swf and demo2_skin.swf).

      These swf files are created throgh Adobe Captivate.

      Playing demo1_skin, will play the demo1.swf with the controls at the button such as "Play", "Pause", "Stop", "Forward", "Backward" and Seekbar.

      Playing demo2_skin, will play the demo2.swf with the controls at the button such as "Play", "Pause", "Stop", "Forward", "Backward" and Seekbar.

       

      Scenario:

       

      1. Clicked on the video1 leaf of the tree. Video1.swf is getting played.

      I am able to click on the seek bar to take the video pointer to the desired position. I can drag the seek bar forward and backward also.

       

      2. Clicked on the video2 leaf of the tree. Video2.swf is getting played.

      I am not able to click on the seek bar to take the video pointer to the desired position. Also, I am not able to drag the pointer on the seek bar either forward or backward also.

       

      Play, Pause, Stop, Forward, Backward buttons on the skin works properly.

       

      3. If I again, click on the video1 leaf, point 1 observation is found.

       

      4. clicking agian, on video2 leaf, point 2 observation found.

       

      Please suggest.

       

      I tried with Loader also. But, nothing fruitful. Same result, as I am getting from SWF Loader.

       

      Please find the below used code.

       

      dp.xml

       

      <?xml version="1.0" encoding="utf-8"?>

      <root>

          <gallery label="All">

                <file label="video1" src="demo1_skin.swf" />

                <file label="video2" src="demo2_skin.swf" />

          </gallery>

      </root>

      ------------------------------------------------------------------------------------------ --------------

       

      Sample1.mxml

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">

       

      <mx:Script>

          <![CDATA[

                    import mx.events.ListEvent;

       

                    private function tree_itemClick(event:ListEvent):void {

                          var t:Tree = event.currentTarget as Tree;

                          var dataObj:Object = event.itemRenderer.data;

       

                          swfLoader.load(null);

                          if (dataObj.hasOwnProperty("@src")) {

                              swfLoader.load(dataObj.@src);

                          }

                    }

                ]]>

      </mx:Script>

       

      <mx:XML id="dp" source="dp.xml" />

          <mx:HDividedBox width="100%" height="100%">

                <mx:Panel width="200" height="100%">

                    <mx:Tree id="tree" dataProvider="{dp}" labelField="@label"

                          showRoot="false" width="100%" height="100%" itemClick="tree_itemClick(event);" />

                    </mx:Panel>

                    <mx:Panel id="panel" width="100%" height="100%" backgroundColor="white">

                          <mx:SWFLoader id="swfLoader" width="100%" height="100%" />

                    </mx:Panel>

          </mx:HDividedBox>

      </mx:Application>

      ------------------------------------------------------------------------------------------ --------------

       

      log in the console

       

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\Sample3.swf - 951,034 bytes after decompression

       

      Clicked on the video1 leaf of the tree

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf - 31,309 bytes after decompression

      this.getSWFVersion() = 7

      contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf - 323,414 bytes after decompression

      incrementWait = 1

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      decrementWait = 0

       

      Clicked on the video2 leaf of the tree

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf - 31,311 bytes after decompression

      [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf

      this.getSWFVersion() = 7

      contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf - 477,273 bytes after decompression

      incrementWait = 1

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      decrementWait = 0

       

      Clicked on the video1 leaf of the tree (Again)

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf - 31,309 bytes after decompression

      [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf

      this.getSWFVersion() = 7

      contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf - 323,414 bytes after decompression

      [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf

      incrementWait = 1

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      decrementWait = 0

       

      Clicked on the video2 leaf of the tree (Again)

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf - 31,311 bytes after decompression

      [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf

      this.getSWFVersion() = 7

      contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf

      [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf - 477,273 bytes after decompression

      incrementWait = 1

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      onLoad m_movie = null

      decrementWait = 0

      [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf