<?xml version="1.0"
encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="top"
horizontalAlign="center"
backgroundGradientColors="[#3B0909, #790707]" paddingTop="0"
backgroundGradientAlphas="[1.0, 1.0]">
<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:Resize id="expand" target="{img}" widthTo="120" heightTo="120"/>
<mx:Resize id="contract" target="{img}" widthTo="24" heightTo="24"/>
<mx:Panel title="Resize Effect" layout="vertical" color="0xffffff" borderAlpha="0.15" width="500" height="230"
paddingTop="5" paddingRight="10" paddingBottom="5" paddingLeft="10" horizontalAlign="center" x="10" y="10">
<mx:Text width="100%" color="0x323232" textAlign="center" paddingBottom="5"
text="Use the Button controls to
resize the image."/>
<mx:Image id="img" width="24" height="24" source="@Embed('images/boots.jpg')"
creationComplete="smoothImage(event);"/>
<mx:ControlBar horizontalAlign="center" paddingTop="3" paddingBottom="3">
<mx:Button label="Expand"
click="expand.end(); expand.play();" color="#110909"/>
<mx:Button label="Contract"
click="contract.end(); contract.play();" color="#110909"/>
</mx:ControlBar>
</mx:Panel>
</mx:Application>
No comments:
Post a Comment