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); 


Reply via email to