Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anyone help me convert this code into an ActionScript loop?

Status
Not open for further replies.

starblood

Technical User
Feb 28, 2001
63
GB
I cannot seem to get the syntax right for converting this into a loop - any help would be appreciated:

square1.attachMovie("sym5", "nn_clip1", 0);
square2.attachMovie("sym5", "nn_clip2", 0);
square3.attachMovie("sym5", "nn_clip3", 0);
square4.attachMovie("sym5", "nn_clip4", 0);
square5.attachMovie("sym5", "nn_clip5", 0);
 
OK - I have the reply. For archive purposes here it is:

for(var i=1; i <=5;i++){ this["square"+i].attachMovie("sym5", "nn_clip", 0);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top