[flexcoders] Stupid Question - Flex width and height
This is probably a dumb question but... I am trying to do a Flex app primarily in AS. In the constuctor I am trying to create an ApplicationControlBar that is the same as this: mx:ApplicationControlBar right=5 left=5 top=55 id=mainACB / I am having a problem with trying to create the same effect as right=5 and left=5. I assume that I need to put the x=5 (hence the left=5) and then do the math to find out the 'stage' size and subtract the other side (5) for the width. However what do I use to do the math? I tried Application.application.stage.width, but I keeping getting a null value error. How can I detect the size of the swf at 100%x100% and do the math or is there an easier way to do this. Didn't see a mainACB.right. Here is what I do have: var mainACB:ApplicationControlBar = new ApplicationControlBar(); mainACB.x = 5; mainACB.y = 65; mainACB.height = 30; mainACB.width = Application.application.stage.width - 5; Application.application.addChild(mainACB);
Re: [flexcoders] Stupid Question - Flex width and height
It would seem to me that Application.application.stage.width only exists when using the Flex framework. Without Flex your just dealing with the 'default' Flash display list. Alan On Jan 12, 2009, at 3:48 PM, Wally Kolcz wrote: Application.application.stage.width
Re: [flexcoders] Stupid Question - Flex width and height
On Mon, Jan 12, 2009 at 9:48 PM, Wally Kolcz wko...@isavepets.com wrote: This is probably a dumb question but... I am trying to do a Flex app primarily in AS. In the constuctor I am trying to create an ApplicationControlBar that is the same as this: mx:ApplicationControlBar right=5 left=5 top=55 id=mainACB / I am having a problem with trying to create the same effect as right=5 and left=5. I assume that I need to put the x=5 (hence the left=5) and then do the math to find out the 'stage' size and subtract the other side (5) for the width. However what do I use to do the math? I tried Application.application.stage.width, but I keeping getting a null value error. How can I detect the size of the swf at 100%x100% and do the math or is there an easier way to do this. Didn't see a mainACB.right. Here is what I do have: var mainACB:ApplicationControlBar = new ApplicationControlBar(); mainACB.x = 5; mainACB.y = 65; mainACB.height = 30; mainACB.width = Application.application.stage.width - 5; Application.application.addChild(mainACB); Em can you not just add mainABC.setStyle(right,5) or am I missing something? I think that this is what you want? Regards, Wesley
Re: [flexcoders] Stupid Question - Flex width and height
Thanks, didn't know that! From: Wesley Acheson wesley.ache...@gmail.com Sent: Monday, January 12, 2009 2:08 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Stupid Question - Flex width and height On Mon, Jan 12, 2009 at 9:48 PM, Wally Kolcz wko...@isavepets.com wrote: This is probably a dumb question but... I am trying to do a Flex app primarily in AS. In the constuctor I am trying to create an ApplicationControlBar that is the same as this: mx:ApplicationControlBar right=5 left=5 top=55 id=mainACB / I am having a problem with trying to create the same effect as right=5 and left=5. I assume that I need to put the x=5 (hence the left=5) and then do the math to find out the 'stage' size and subtract the other side (5) for the width. However what do I use to do the math? I tried Application.application.stage.width, but I keeping getting a null value error. How can I detect the size of the swf at 100%x100% and do the math or is there an easier way to do this. Didn't see a mainACB.right. Here is what I do have: var mainACB:ApplicationControlBar = new ApplicationControlBar(); mainACB.x = 5; mainACB.y = 65; mainACB.height = 30; mainACB.width = Application.application.stage.width - 5; Application.application.addChild(mainACB); Em can you not just add mainABC.setStyle(right,5) or am I missing something? I think that this is what you want? Regards, Wesley