Link to home
Start Free TrialLog in
Avatar of msukow
msukowFlag for United States of America

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("LeftMenuMC_1", "leftMenuOptionMC_1", 1);
menuMC1._x = 10;
menuMC1._y = 100;
// Creates Option 2 MC Button
menuMC2.attachMovie("LeftMenuMC_2", "leftMenuOptionMC_2", 2);
menuMC2._x = 10;
menuMC2._y = 125;
// Creates Option 3 MC Button
menuMC3.attachMovie("LeftMenuMC_3", "leftMenuOptionMC_3", 3);
menuMC3._x = 10;
menuMC3._y = 150;
// Creates Option 4 MC Button
menuMC4.attachMovie("LeftMenuMC_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!
ASKER CERTIFIED SOLUTION
Avatar of trigger-happy
trigger-happy
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial