Mega Code Archive

 
Categories / Flex / Graphics
 

Set Image Source to change image file for an Image control

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#eeeeee">   <mx:Script>            [Embed(source="logo.jpg")]       [Bindable]       public var flowerImage1:Class;       [Embed(source="logo.jpg")]       [Bindable]       public var flowerImage2:Class;      </mx:Script>   <mx:Image id="myImage" source="{flowerImage1}"/>   <mx:Button label="Change Image" click="myImage.source=flowerImage2"/>    </mx:Application>