flex move and zoom

<?xml version="1.0" encoding="utf-8"?>   
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  
    >   
    <mx:Script>   
        <![CDATA[   
        	
            import mx.effects.Zoom;
            import mx.effects.Move; 
            //变大变小     
            private function zoomTest():void   
            {   
                var zoom:Zoom = new Zoom();   
	                //指定目标   
	                zoom.target = myImage;    
	                //过程耗时   
	                zoom.duration = 2000;   
	                //目标增加高度倍数   
	                zoom.zoomHeightTo = 1.5;   
	                //目标增加宽度倍数   
	                zoom.zoomWidthTo = 1.5;   
	                //开始   
	                zoom.play();    
            } 
           
            //移动   
            private function moveTest1():void   
            {   
                var move:Move = new Move();   
	                move.target = myImage; 
	                //过程耗时  
	                move.duration = 2000;   
	                //指定x   
	                move.xTo = 230;   
	                //指定y   
	                move.yTo = 0;   
	                //移动   
	                move.play();   
            }   
        ]]>   
    </mx:Script>   
    <mx:Panel id="myPanel" width="90%" height="90%" title="移动示例:点击图片">   
        <mx:Image id="myImage" source="assets/1.jpg" click="zoomTest()"/>   
    </mx:Panel>   
</mx:Application>

你可能感兴趣的:(xml,Flex)