Associate the embedded image with a variable by using [Embed] metadata tag
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> [Embed(source="a.gif")] [Bindable] public var imgCls:Class; </mx:Script> <mx:Button label="Icon Button 1" icon="{imgCls}"/> <mx:Button label="Icon Button 2" icon="{imgCls}"/> </mx:Application>