views:

12

answers:

1

How do I get the size of the content area of Container objects? One non generic solution is checking for styles I suppose but I am looking for some code that works generic for all standard flex Container objects.

Edit: The controls are Flex 3

A: 

You mean other than simply doing container.width and container.height?

Edit from comment :

Ah ok.

Container has a mx_internal variable called contentPane which is a Sprite that you can get the width and height from.

import mx_internal;
use namespace mx_internal;
var containerWidth : Number = container.mx_internal::contentPane.width;
var containerHeight : Number = container.mx_internal::contentPane.height;
Gregor Kiddie
Controls like Panels have a title and a status bar. The content area is not the whole control but only a part of it. I would like to have the boundaries of the content area only.
natorion
Not really an answer - but http://livedocs.adobe.com/flex/3/langref/mx/core/IContainer.html#viewMetrics might help you. That and headerHeight.
danyal
edited with what you might be looking for.
Gregor Kiddie
Thank you, that might work!
natorion