Now button stays always in middle of the black box.
Check the code below: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Style> @font-face { src:url("MyriadPro-Bold.otf"); fontFamily: "MyriadAIR"; fontWeight: bold; advanced-anti-aliasing: true; } Canvas { fontFamily: MyriadAIR; fontSize: 15; } </mx:Style> <mx:Script> <![CDATA[ public function init():void { var point:Point=new Point(wfName.x+wfName.width/ 2, wfName.y+wfName.height/2); var m:Matrix=wfName.transform.matrix; m.tx -= point.x; m.ty -= point.y; m.rotate (-90*(Math.PI/180)); m.tx += point.x; m.ty += point.y; wfName.transform.matrix=m; } ]]> </mx:Script> <mx:Canvas width="50%" height="50%" borderStyle="solid" verticalCenter="0" horizontalCenter="0"> <mx:VBox horizontalAlign="center" verticalAlign="middle" top="5" bottom="5" left="5" width="70" borderStyle="solid" borderColor="#000000" cornerRadius="5" borderThickness="4"> <mx:Canvas> <mx:Button id="wfName" label="The" verticalCenter="0" horizontalCenter="0"/> </mx:Canvas> </mx:VBox> </mx:Canvas> </mx:Application> regards, Sumant --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_india@googlegroups.com To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---