Filter Criteria

Select Your Category Select a component

Image control



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#874040, #874040]">   
   
    <mx:Script>
        <![CDATA[
            private function smoothImage(ev:Event):void{
                //set image smoothing so image looks better when transformed.
                var bmp:Bitmap = ev.target.content as Bitmap;
                bmp.smoothing = true;
            }
        ]]>
    </mx:Script>
    <mx:Panel title="Image Samples" layout="horizontal" color="0xffffff" borderAlpha="0.15"
         paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center" x="10" y="10">
       
        <mx:VBox width="100%" borderColor="0xACACAC" borderThickness="1" borderStyle="solid" horizontalAlign="center"
             paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5" >
            <mx:Text color="0x323232" text="Sample of image embeded at compile time." />
            <mx:Image id="embededImage" source="@Embed('compass.jpg')" creationComplete="smoothImage(event);"/>
        </mx:VBox>
       
        <mx:VBox width="100%" borderColor="0xACACAC" borderThickness="1" borderStyle="solid" horizontalAlign="center"
             paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5">
            <mx:Text color="0x323232" text="Sample of image loaded at run-time." />
            <mx:Image id="loadedImage" source="backpack.jpg" creationComplete="smoothImage(event);"/>
        </mx:VBox>
    </mx:Panel>
</mx:Application>


No comments:

Post a Comment