Boon Chew wrote:
Will getChildByName work with a nested target name (e.g. "_level0.mc1.mc2.mc3")?

No, it gets the child with the particular name in the display object container. You'll want to split the string apart:

// Not tested - but you get the basic idea
var parts:Array = name.split( '.' );
var reference:DisplayObject = root;
for ( var i:int = 0; i < parts.length; i++ ) {
   reference = reference.getChildByName( parts[ i ] );
}
// use reference here

The above loop is equivalent to:
reference = root.getChildByName( "mc1" ).getChildByName( "mc2" ).getChildByName( "mc3" );

-d

_______________________________________________
[email protected]
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

Reply via email to