Mega Code Archive

 
Categories / Flex / Components
 

Transform a button around

<mx:Application      xmlns:mx="http://www.adobe.com/2006/mxml"       xmlns:s="library://ns.adobe.com/flex/spark">          <mx:Script>                      import mx.core.UIComponent;                          private function pushOver( evt:MouseEvent ):void             {                 var angle:Number = btn1.rotationZ + 90;                 btn1.transformAround( new Vector3D( btn1.width, btn1.height / 2 ), null, new Vector3D( 0, 0, angle ) );             }            </mx:Script>          <mx:VBox>         <mx:Button id="btn1" label="push over" click="pushOver(event);" />     </mx:VBox>      </mx:Application>