PDA

View Full Version : Attaching movieclips



Cybernoid
April 29th, 2005, 09:38 AM
Why doesn't this work? This code is in one of the movieclips on the stage inside onEnterFrame-handler.



if(_root.printed==0)
{

for(i=0;i<_root.lives;i++)
{
_root.attachMovie("lifex", "lives"+i, 30000+i);
axa=24*i;
yxy=200;
setProperty ("lives"+i, _x,axa);
setProperty ("lives"+i, _y,200);
}

_root.printed=1;
}


When I list the objects it says all the objects are there, but I only see one. What's wrong?

glkngs
April 29th, 2005, 09:50 AM
you are attaching the clips to root. are you sure that the setProperty is referring to root aswell?
What version do you use?

Cybernoid
April 29th, 2005, 10:17 AM
I'm using MX2004, and I'm not sure where it's referring to. Can I just put _root. in front of that?

Cybernoid
April 29th, 2005, 10:18 AM
Ok, I got it. You were right, I needed to have



(_root["lives"+i], _x,axa);


Thanks!