PDA

View Full Version : Setting names dynamically to duplicated MCs


Noam
02-05-2002, 08:59 AM
Hello,

I'm having difficulty with a script that runs well on Flash 4 but not on Flash 5.

I want to duplicate a clip to create, lets say, a flower, so I use an MC of a petal and use the following in the instance's frame:

for (i=1; i<20; i++) {
var newPetal = ("petal" + i);
dupicateMovieClip ("petal", newpetal, i);
set (newPetal._rotation, i*5);
}

My problen is in the last line. I can't set dynamically the new instance name. I've tried to change the syntax:
//*
newPetal._rotaion += 5;
*//
but with no success.

Any ideas?

Many thanks in advance

Noam


P.S . In the attachment is the file that was created with Flash 4.

pinkaboo
02-05-2002, 09:36 AM
try:


for (i=1; i<20; i++) {
duplicateMovieClip("petal", "petal"+i, i);
_root["petal"+i]._rotation = i*5;
}



Kay

Noam
02-05-2002, 11:03 AM
See subject.

Noam