-
Multiple loops not working...
Hello all.
I'm new to flash, and this is my first post.
I'm using Flash MX Pro, 2004 V7.
I have this code in the first frame:
________________________________________
for (i = 0; i < 5; i++){
_root.attachMovie("A","A_" + i, i + 10);
}
for (i = 0; i < 5; i++){
_root.attachMovie("T","T_" + i, i + 10);
}
for (i = 0; i < 5; i++){
_root.attachMovie("C","C_" + i, i + 10);
}
for (i = 0; i < 5; i++){
_root.attachMovie("G","G_" + i, i + 10);
}
________________________________________
The last movie clip ("G") loads and works great. The other three do not.
If I erase one loop, flash just runs the last loop in the sequence. Nothing I've tried seems to get them all working at once.
Thanks in advance for your help!
-Bio Teacher
-
you need to set the depth of each movieClip to an individual depth.
for (i = 0; i < 5; i++){
_root.attachMovie("A","A_" + i, i + 10);
}
for (i = 0; i < 5; i++){
_root.attachMovie("T","T_" + i, i + 20);
}
also you can shorten your code...
for (i = 0; i < 5; i++){
_root.attachMovie("A","A_" + i, i );
_root.attachMovie("T","T_" + i, i + 10);
}
-
Excellent, thanks! That fixed it, and I think I understand layers now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|