Accessing an MC created dynamically

hello:
i have a problem accessing an MC inside another MC created dynamically.
can someone help me on this?
here is my code:


first frame of _root:
for (var i=0;i<5;i++) {
var newname:String = "newnavboxmc"+i;
  _root.navboxmc.duplicateMovieClip(newname,i);
_root[newname].holder_mc.bandname = "Bastard Dogs";
}

and getting the value of “bandname” using a button event:


on (release) {
trace (_root.newnavboxmc0.holder_mc.bandname);
}

it always shows an “undefined” error.

any help is very much appreciated.
thanks in advance.

use attachMovie() instead.

duplicate movie and attachMovie both functions return instance of newly created movieclip you can store the references in variables
OR
for your case this will work too
[FONT=Courier New][LEFT][COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]navboxmc[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]“newnavboxmc”[/COLOR]+i[COLOR=#000000]][/COLOR]
[/LEFT]
[/FONT]
i will be the numbers you used to create them