tags:

views:

57

answers:

1

Why is it that the mx.core.Container uses its contentPane sometimes, but doesn't at other times?

Or, in other words, how come the children of Container are only put into the contentPane if some complex logic decides that they should be put there? Why not simply always put all children in the contentPane?

A: 

If memory serves, addingChild() (which is probably an inherited method) in the sdk will be your answer. It has to do with styles and since I'm not the person to talk to about styles, I'm turning this answer into a community wiki, can't say I've ever done this...

jeremy.mooer
I've looked through `addingChild`, but like most places, it doesn't seem like the optionality of `contentPane` makes sense there either - like in most places, it just serves to make the function more complex.
David Wolever
Yeah, looks like, as my first sentence suggests, my memory didn't serve me well.... in fact I'm pretty sure I never knew this one. This has much less (though some) to do with styles than it does how containers work. I googled 'contentPane flex' and there isn't much of anything out there. Going through Container's source, it looks like it is used for scrolling. I'm laying on the couch with a beer, so I half-assed looking through the code, but that's what she's looking like -- scrolling.
jeremy.mooer