Rotate and Move : Rotate « Event « Flex






Rotate and Move

Rotate and Move
         

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->


    <!-- behaviors\SparkXFormRotateMoveAutoCenter.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark">
    <fx:Declarations>
        <s:Parallel id="parallelRMForward" target="{myImage}">
            <s:Rotate angleBy="180" autoCenterTransform="true" />
            <s:Move xBy="100" yBy="100" autoCenterTransform="true" />
        </s:Parallel>
        <s:Parallel id="parallelRMBack" target="{myImage}">
            <s:Rotate angleBy="180" autoCenterTransform="true" />
            <s:Move xBy="-100" yBy="-100" autoCenterTransform="true" />
        </s:Parallel>
    </fx:Declarations>
    <s:Button label="Play Effect Forward" x="10" y="10"
        click="parallelRMForward.end();parallelRMForward.play();" />
    <s:Button label="Play Effect Backward" x="150" y="10"
        click="parallelRMBack.end();parallelRMBack.play();" />
    <mx:Image id="myImage" x="10" y="50" source="@Embed(source='a.jpg')" />
</s:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Rotating the button 45 degreesRotating the button 45 degrees
2.Rotate image around z-axis, with applyChangesPostLayout property set to false.Rotate image around z-axis, with applyChangesPostLayout property set to false.
3.Rotate after Button creation completedRotate after Button creation completed