msukow
asked on
Loop attachMovie and position movieclips
I have the following code:
for (i=1; i<10; i++) {
this.createEmptyMovieClip( "menuMC"+i , i);
}
//
// Creates Option 2 MC Button
menuMC1.attachMovie("LeftM enuMC_1", "leftMenuOptionMC_1", 1);
menuMC1._x = 10;
menuMC1._y = 100;
// Creates Option 2 MC Button
menuMC2.attachMovie("LeftM enuMC_2", "leftMenuOptionMC_2", 2);
menuMC2._x = 10;
menuMC2._y = 125;
// Creates Option 3 MC Button
menuMC3.attachMovie("LeftM enuMC_3", "leftMenuOptionMC_3", 3);
menuMC3._x = 10;
menuMC3._y = 150;
// Creates Option 4 MC Button
menuMC4.attachMovie("LeftM enuMC_4", "leftMenuOptionMC_4", 4);
menuMC4._x = 10;
menuMC4._y = 175;
I want to be able to loop through the number of MCs needed, attach them, then position them. I have tried using EVAL, but not sure what the format would be. The MCs are created and in the library with names like LeftMenuMC_1, LeftMenuMC_2, etc.
Thanks up front!
for (i=1; i<10; i++) {
this.createEmptyMovieClip(
}
//
// Creates Option 2 MC Button
menuMC1.attachMovie("LeftM
menuMC1._x = 10;
menuMC1._y = 100;
// Creates Option 2 MC Button
menuMC2.attachMovie("LeftM
menuMC2._x = 10;
menuMC2._y = 125;
// Creates Option 3 MC Button
menuMC3.attachMovie("LeftM
menuMC3._x = 10;
menuMC3._y = 150;
// Creates Option 4 MC Button
menuMC4.attachMovie("LeftM
menuMC4._x = 10;
menuMC4._y = 175;
I want to be able to loop through the number of MCs needed, attach them, then position them. I have tried using EVAL, but not sure what the format would be. The MCs are created and in the library with names like LeftMenuMC_1, LeftMenuMC_2, etc.
Thanks up front!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.