AS3 migration, display list strategy questions..
Hello all, this is a bit of a strategy question for larger scale flash apps. I've been holding back on AS3 for obviously a very long time and I have some basic questions.
I'm very used to building things with hard references in mind using AS2. I build it knowing I'm going to put a panel A in _level0.panela_mc and interface B in _level0.interfaceb_mc and Login Prompt in _level0.login_mc.login_com, etc etc.. I always know these will exist and you simply reference them via _level0.whatever. What is the new strategy to managing references to lots of sprites?
If I build a panel in a class method, the var somepanel:Sprite = new Sprite() I create inside the method to hold the panel I'm making will be up for garbage collection if I don't make sure a reference stays intact (via either add it to a display list, add an event handler, etc..). The reference "somepanel" I made in the method will go out of scope at the end of the method as well. Should I expect to have needed to make a class variable ahead of time to store a reference to this? Should I be keeping a class genericObject:Object that holds a list of references to everything I ever make almost like a global registry?
I'm just used to AS2. You just create a movieclip and when the method ends, the clip still exists and you know the _level0.ref.ref.ref will always exist and how to get back to it.
How are larger projects managed where content loaded isn't known ahead of time and the layout is rather dynamic. What are the strategies used to manage all that dynamic chaos?
Lastly I'm so overly used to being able to target a movieclip using a single daisy chained list of clips, like: _level0.this_mc.that_mc.those_mc. I noticed I can't seem to do this approach with the getChild() approach. using someSprite.getChildByName('this').getChildByName('that').getChildByName('those') doesn't work. How do you drill down into nested clips? I did notice I can do it one level at a time, such as: refA = someSprite.getChildByName('this'); refB = refA.getChildByName('that'); refC = refB.getChildByName('those'); .. Is that what I'm expected to do?
Thanks for some tips!
