Don't know how to respond to this. If you need 80% of Canvas, derive from Canvas, otherwise derive from Container. Look at how we did Canvas and Panel to see how content and rawChildren are handled. Post a test case if there are still problems.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Monday, June 02, 2008 4:50 PM To: [email protected] Subject: [flexcoders] The best way to subclass Container or Canvas? Children being measured as 0x0, various other issues Hey guys, I've got a component that extends Canvas (for borders etc), adds its own chrome using rawChildren.addChild, and overrides the other addChild / removeChild methods delegating them to an internal Canvas. This is extended by other developers to build MXML components. I'm having a whole bunch of problems with the contentCanvas and its children not measuring properly, and ignoring sizing I do give it. Also, if I override numChildren I get out-of-bounds exceptions somewhere in framework code that's called from a callLater, of which I have no idea where it's being dispatched or why it has an incorrect _firstChild What I'd like is to have the contentCanvas look after everything it contains, report a useful measuredWidth and measuredHeight so I can use them to measure my own component, but for it to still do as its told when I explicitly give it a width and height in updateDisplayList() Clearly I'm doing something seriously wrong, but I can't for the life of me figure out how I *should* be doing all this, so any pointers are definitely appreciated! I'd like to avoid extending UIComponent and re-implementing the hundred or so methods in IContainer, IRawChildren, IFocusManager, IChildList, etc etc etc only to have it not work becuase I've repeated the same mistake. -J -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

