Using the [Embed] metadata tag
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100" height="80" borderStyle="solid"> <mx:Script> [Embed(source="a.gif")] [Bindable] public var imgCls:Class; </mx:Script> <mx:Image source="{imgCls}"/> </mx:Application>