2010-11-10 150 views
1

我正在使用swfLoader在我的flex/actionscript代碼中加載外部Flash動畫。如果加載的swf是爲更新的Flash播放器版本而製作的(我相信9.0或更高版本),它將作爲flash.display.MovieClip對象加載,該對象具有播放/暫停和轉到幀的方法。但是,如果加載的SWF是爲較老的Flash Player製作的(我相信6.0),那麼它會加載爲flash.display.av1movie,它沒有播放/暫停的方法。有沒有一種方法可以從我的flex代碼中播放/暫停av1movie。從flex播放/暫停flash.display.avm1movie

回答

3

有一種方法:ForcibleLoader。它像這樣工作 - 將swf加載爲ByteArray,然後修改它並使用loadBytes加載結果。它將as3標誌設置爲true,並將swf版本設置爲9.但是,請注意,由於與AVM1有很多不同,因此as2腳本在AVM2中無法正常工作。但是如果你有簡單的動畫,這可能會奏效。您將獲得MovieClip而不是AVM1Movie,只需對其進行測試即可。

+0

+1有趣,不知道這個! ;) – PatrickS 2010-11-10 09:13:28

+0

鏈接不起作用了。試試這個:http://code.google.com/p/as3-classes/source/browse/trunk/org/lzyy/util/ForcibleLoader.as – Triynko 2012-09-05 21:35:49

1

不,沒有!

從文檔:

The AVM1Movie object can use methods and properties inherited from the 
    DisplayObject class (such as x, y, width, and so on). However, no 
    interoperability (such as calling methods or using parameters) 
    between the AVM1Movie object and AVM2 objects is allowed.