1. First create Animation.swf Flash file. It has effects you want to assign to Flex button.
2. Animation.swf contains symbol name. Now you create simple actionscript class call Assets.as
public class Assets{
[Embed(source='assets/animations/Animation.swf#square')]
public static var animation_icon:Class;
}
3. Make sure you have "square" symbol or any other name symbol in Flash file. That symbol will have animation or effects you want to assign to flex button.
4. Now in your Flex or actionscript code where you have created button assign the effects like this
button.setStyle("icon",Assets.animation_icon);
5. You can remove the effects using following
button.styleName = (any normal button style you want to see);
Now you can see the animation or effects in Flex button.
Enjoy.
No comments:
Post a Comment