Applying skins by using the Style Manager
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init()">
<mx:Script>
import mx.styles.StyleManager;
[Embed("a.gif")]
public var os:Class;
[Embed("b.gif")]
public var ds:Class;
[Embed("a.gif")]
public var us:Class;
private function init():void {
StyleManager.getStyleDeclaration("Button").setStyle("upSkin", us);
StyleManager.getStyleDeclaration("Button").setStyle("overSkin", os);
StyleManager.getStyleDeclaration("Button").setStyle("downSkin", ds);
}
</mx:Script>
<mx:Button label="Click Me" id="b1"/>
</mx:Application>
Related examples in the same category