Flex 4 ~ animate scale effect

MXML
--------------------------------------------------------------------------------------------------------------------------

<fx:Declarations>
<s:Scale id="scaleEffect" target="{PreviewImage}" duration="200" />
</fx:Declarations>

<mx:Image id="PreviewImage" x="0" y="0"  />



Action Script
--------------------------------------------------------------------------------------------------------------------------
private function zoomInImage():void{

scaleEffect.scaleXTo = PreviewImage.scaleX + 0.15;
scaleEffect.scaleYTo = PreviewImage.scaleY + 0.15;
scaleEffect.end();
scaleEffect.play();
}



reference
http://help.adobe.com/en_US/flex/using/WS6461B3EC-1AED-486d-A4B8-8EBD1993CE22.html

沒有留言: