1. 程式人生 > >Flex Rotate旋轉效果

Flex Rotate旋轉效果

Rotate 效果可圍繞指定的點旋轉元件。您可以指定旋轉中心的座標以及旋轉的起始角度和最終角度。既可以指定正角度值,也可以指定負角度值。

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="200" 
     width="400"> 
        <mx:Rotate id="rotate" angleFrom="0.0" angleTo="-900"  
            target="{img}"/> 
        <mx:Rotate id="rotate1" angleFrom="0.0" angleTo="900"  
            target="{img0}"/> 
        <mx:HBox width="174"> 
                <mx:Image source="@Embed(source='./000.jpeg')" id="img"  
                    click="rotate.end();rotate.play()"/> 
                <mx:Image source="@Embed(source='./111.jpeg')" id="img0"  
                    click="rotate1.end();rotate1.play()"/> 
        </mx:HBox> 
        <mx:Label text="點選圖片" width="111" fontSize="14"/> 
</mx:Application> 
iet Thurndon</artist>

簡要說明:angleFrom屬性表示目標物件的起始旋轉角度(以度表示)。angleTo屬性表示目標物件結束旋轉時的角度(以度表示)。

originX 旋轉中心點的 x 位置,originY屬性設定旋轉中心點的Y位置。