Reputation: 6843
I need to skin a Flex button using a MovieClip exported as .swf from Flash Professional. Most of the instructions online say that I need to do something along these lines:
[Embed(source='Button.swf', symbol="AudioButtonDown")]
public var Down:Class;
[Embed(source='Button.swf', symbol="AudioButtonOver")]
public var Over:Class;
[Embed(source='Button.swf', symbol="AudioButtonNormal")]
public var Normal:Class;
...
Button1.setStyle('overSkin',Over);
Button1.setStyle('downSkin',Down);
Button1.setStyle('upSkin',Normal);
Which works great if each frame of the movieclip could have it's own symbol. But what I have is a single movieclip with 3 frames, and a single symbol "AudioButton", and when I try to apply it as a skin, the three frames just play over and over again in an endless loop. How can I divvy up the frames of a loaded swf, and apply frame 1 to "upSkin" frame 2 to "overSkin", etc...?
Thanks In Advance.
Upvotes: 1
Views: 203
Reputation: 12847
Creating symbols for each state would be the easiest way to go, but not the only one (however, the symbol approach is the one you should use).
Another way to do it would be to just set the skin as the one symbol and from there do yourSymbol.goToAndStop('someButtonState')
. This is strongly discouraged before Flex doesn't work with frames and it could have adverse effects.
Upvotes: 1