Hi Julian, They do return references. You just have to cast them to the correct type.
e.g. var clip:MyClip=MyClip(attachMovie("SymbolName",instanceName,depth)); HTH, Ian On 7/7/06, Julian Bleecker <[EMAIL PROTECTED]> wrote:
Yeah, I think it gets worse. I'm used to a pattern where you create a whole bunch of something — so, back to the problem I originally asked, if I want have my "mainClip" create a dozen subClip instances and tuck each one of those instances in an Array for later use, especially calling that useful method. I guess I'm asking how one can call a method on an instance where the instance's name is derived at runtime. For instance, in this example you provided, which works for the single "subClip00" instance variable, how would I do the same thing, only with a runtime derived name? class mainClip extends MovieClip { public var subClip00:subClip; function mainClip() { trace("new mainClip!"); init(); } function init():Void { for(int i=0; i<12; i++) { attachMovie("subClip", "subClip_"+i, this.getNextHighestDepth()); //this.subClip00.usefulMethod(); this won't work..how to call a method with no reference — only a name? } } } But, the bigger question is: why don't things like attachMovie or such return references to the things they're "attaching"? Julian On Jul 6, 2006, at 20:50 PDT, Mike Britton wrote: > Perhaps, but you never know: someone on this list may have a better > solution for your problem. > > Mike > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com