Mega Code Archive

 
Categories / Flex / Development
 

Create and manipulate an object that represents the embedded image before passing it to a control

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Script>               import mx.core.BitmapAsset;          [Embed(source="a.gif")]          [Bindable]     public var imgCls:Class;     public var varOne:String = "This is a public variable";          private function modImage():void {         var imgObj:BitmapAsset = new imgCls() as BitmapAsset;         imgObj.bitmapData.noise(4);         myImage.source=imgObj;     }        </mx:Script>     <mx:HBox>         <mx:Image id="myImageRaw" source="{imgCls}"/>         <mx:Image id="myImage" creationComplete="modImage();"/>         <mx:Text id="myText" text="foo"/>     </mx:HBox> </mx:Application>