Here is the code. I am also attaching the font file. Once the application first show up you can see that the button is in the middle but then if you make the browser small or big you will see that the button is not in the middle any more.
<?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:Canvas top="5" bottom="5" left="5" width="70" borderStyle="solid" borderColor="#000000" cornerRadius="5" borderThickness="4"> <mx:Button id="wfName" label="The" verticalCenter="0" horizontalCenter="0"/> </mx:Canvas> </mx:Canvas> </mx:Application> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- On Sun, Oct 4, 2009 at 11:02 AM, Sumant <[email protected]> wrote: > > In canvas this is difficult to put inner objects in vertically/ > horizontally in middle. see by putting that button in VBox/HBox and > set verticalAlign and horizontalAlign middle and center respectively. > > I am not getting what is actually happening. If this is not the > solution, then please post the code. I will try to solve. > > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

