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

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » Button EffectScreenshots 
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;
            [Bindableprivate var rot:Number = 45;
            private function rotate():void
            {
                var matrix:Matrix3D = button.getLayoutMatrix3D();
                matrix.appendRotation45, 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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.