Setting property of duplicated component?

hi there, ive got a radiobutton component on my stage named radio1.
I need to duplicate it and then change a few properties, but i cant seem to get the path/naming right. This is my code:


i=2;
radio1.duplicateMovieClip("radio"+i, radio1.getNextHighestDepth(), {_x:20, _y:20});
_root["radio"+i].setLabel("test");
i++

if i use a constant name instead of “radio”+i it works but the [“radio”+i] seems to be the problem, could someone help me with this? (using flash mx)

shouldnt it be:

i=2;
duplicateMovieClip(radio1,"radio"+i, radio1.getNextHighestDepth(), {_x:20, _y:20});
_root["radio"+i].setLabel("test");
i++

?? try that an lemme know (im usin FMX so mite b slightly diff in FMX2004… for instance i dont have the getNextHighestDepth() function :frowning: )

Prophet.

duplication works fine as it is, only this part doesnt work:
_root[“radio”+i].setLabel(“test”);

Its about the _root[“radio”+i] , this doenst work but i dont know why. Cause its an component? could someone please help…

if duplication was working correctly then so should that

Prophet.

It still doesnt work, as i said, duplication works (a duplicate of the instance in question appears) only setting the property is failing…

Radiobutton doesnt have a setLabel() method;

use

 RadioButtonInstanceName.label = "some Text"; 

nope, not working either

it should work,
check the instance name…