how to control a embedded multiframe swf file?
[Embed(source="data/fire.swf")] static public var movieFire:Class;
I have some multiframe swf file and I want to have control of them. For example, I can use gotoandplay and gotoandstop functionality.
I tried something like:
var m:MovieClip = new movieFire() as MovieClip;
but it turns out when I tried to get totalFrames, m.totalFrames
, it gives me zero, and gotoand* functions don't work either. How can I correctly control the swf file embedded in actionsript 3.0 (开发者_Go百科No Flex component)?
Basically you need make swf file, where is needed movieClips exported for actionscript. After what you need embed these symbols to your flex code:
[Embed(source="../lib/trash.swf", symbol="emptytrash")]
private static const _trash:Class;
private static var trash:MovieClip = new _trash();
in FlashDevelop can you easily do that.
Don't forget to publish SWF in actionscript 3 language and same version, as you use for compiling flex application.
精彩评论