2011-09-13 97 views

回答

0

您無法在Flash Builder(即Flex)IDE中直接編輯Flash文件。但是,您可以從Flex中訪問已發佈的swf。

一個常見的用途是從庫swf - http://www.bit-101.com/blog/?p=853訪問資產。但我認爲你有興趣訪問交互中的特定幀。不同的選項是可能的:

  1. 使用的localConnection - http://fbflex.wordpress.com/2008/06/12/passing-data-from-flash-to-flex-and-back/
  2. 負載生成的SWF成加載器對象並導航到框架 - SWFLoader starts to play SWF without the loading being complete
  3. 負載生成的SWF成加載器對象和經由事件通信

<mx:SWFLoader id="embeddedFlash" source="path/to/file.swf" complete="onLoaderComplete(event)"/> 

<mx:Script> 
    <![CDATA[ 
    private function onLoaderComplete(event:Event) 
    { 
     // the swf file needs to be fully loaded before these calls are made 
     if(embeddedFlash.content) 
     { 
      // 2 - navigate to frame 
      var mc:MovieClip = MovieClip(embeddedFlash.content); 
      mc.gotoAndPlay(0); 
      // 3 - communicate via events 
      embeddedFlash.content.addEventListener("nextButtonClick",  onNextClick); 
      embeddedFlash.content.dispatchEvent(new Event("changeOptions", {/* pass on data */})); 
     } 
    } 
    ]]> 
</mx:Script> 
相關問題