Use Matrix3D to Apply Transformations Within a Layout : Button Effect « Components « Flex






Use Matrix3D to Apply Transformations Within a Layout

Use Matrix3D to Apply Transformations Within a Layout
           
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark">
    <mx:Script>
        
            import mx.core.UIComponent;
            [Bindable] private var rot:Number = 45;
            private function rotate():void
            {
                var matrix:Matrix3D = button.getLayoutMatrix3D();
                matrix.appendRotation( 45, Vector3D.Z_AXIS );
                button.layoutMatrix3D = matrix;
                rot += 45;
            }
      
    </mx:Script>
    <s:Group>
        <s:Group width="120">
            <mx:Button id="button" label="Rotate" click="rotate();" />
            <s:Rect id="rect" rotationZ="{rot}" width="110" height="50">
                <s:fill>
                    <mx:SolidColor color="#000000" />
                </s:fill>
            </s:Rect>
        </s:Group>
        <s:Rect width="100%" height="100%">
            <s:stroke>
                <mx:SolidColorStroke color="#000000" />
            </s:stroke>
        </s:Rect>
    </s:Group>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Using the Move effect to move the button diagonallyUsing the Move effect to move the button diagonally
2.Button with rollOverEffect propertyButton with rollOverEffect property
3.Button with mouseDownEffectButton with mouseDownEffect
4.Button mouse down effectButton mouse down effect
5.Button creationCompleteEffectButton creationCompleteEffect
6.Button mouse down and mouse up effectButton mouse down and mouse up effect
7.Add SoundEffect to Button mouse down effectAdd SoundEffect to Button mouse down effect
8.Button WipeLeftButton WipeLeft
9.Transform a button aroundTransform a button around