tags:

views:

467

answers:

1

I am calculating the maxHeight of an Image embedded in a Canvas-based component that is part of a Canvas-based component that is the child of an Accordion.

I need to get the actual number of pixels available to the currently selected child Container. Oddly enough, measuredHeight and getExplicitOrMeasuredHeight() give the design-time size of the Canvas I used as an Accordion's child Container. not the run-time size based on height="100%" or top="10" bottom="10".

I expected that the Accordion's children will be sized to the client area of the Accordion and that would allow my code to figure out how large the Image could be without inducing scroll bars. I've walked through the Accordion.as source, but nothing jumps out at me. I'm about to sub-class Accordion just to make protected function get contentHeight():Number a public function.

Any ideas?

+1  A: 

Maybe this will help:

accordion.height - (accordion.numChildren * Number(accordion.getStyle("headerHeight")))

and optionally + border widths.

radekg