Question: Duplicate Movie Clip changing text problem

How would i go about changing dynamic text (with the var “text”) in my mc when duplicating it?
Heres my code:
[AS]_root.button._visible = 0;
label = new Array(“Home”, “Service”, “Portfolio”, “Contact”);
length = label.length;
for(i=0; i < length; i++) {

name = “b” + i;
dis += 26;
_root.button.duplicateMovieClip(name, i);
setProperty(name, _y, dis);
_root.name.text = label*;

}[/AS]

My problem is the 2nd to last line: _root.name.text = label*; How could I get this to be dynamic so I could put a variable like “name” in the path of the new mc rather than writing:
_root.b0.text = label[0];
_root.b1.text = label[1];
and so forth. Any help would be great! Thanks.

[AS]_root.button._visible = 0;
label = new Array(“Home”, “Service”, “Portfolio”, “Contact”);

for(i=0; i < label.length; i++) {
_root.button.duplicateMovieClip(“copy”+i, i);
ext = _root[“copy”+i];
ext._y = 26 * i;
ext.name.text = label*;
}[/AS]

that should work.

Hey thanks for your time. I just checked another place I posted this and found that the code:
_root[name].text = label*;
worked as well. Thanks!

yup that would work as well. :slight_smile: