bape
August 31, 2004, 1:08pm
1
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)
system
August 31, 2004, 6:06pm
2
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 )
Prophet.
system
September 1, 2004, 10:46am
3
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…
system
September 1, 2004, 5:46pm
4
if duplication was working correctly then so should that
Prophet.
system
September 13, 2004, 10:42am
5
It still doesnt work, as i said, duplication works (a duplicate of the instance in question appears) only setting the property is failing…
system
September 13, 2004, 12:07pm
6
Radiobutton doesnt have a setLabel() method;
use
RadioButtonInstanceName.label = "some Text";
system
September 21, 2004, 9:41am
8
it should work,
check the instance name…