I'm programmatically creating a spark BorderContainer in ActionScript and filling it with a few labels. After I make it visible, it's width is 298 pixels. However, I only know this because I'm taking a screenshot and measuring the width. If I trace() the width, or explicitWidth, or measuredWidth, or getExplicitOrMeasuredWidth(), or getLayoutBoundsWidth() ... ad nauseum ... the reported width is always 42 pixels. Without fail. Period. ALWAYS!
Does anyone know how the hell I can get the width that is visible on the screen? It's absolutely ridiculous how easy this should be, but isn't.
So...have I perhaps found a bug?
Figured it out with the help of Alex Hurai from the Flex SDK Team. I was trying to access the width property (and the host of other properties I mentioned) before the FlexEvent.UPDATE_COMPLETE event had fired. Once I began listening for that event after instantiating the BorderContainer, I got the correct width.
Props to Alex!