This should be an easy one cos I think I’m close already.
Basically, I want to loop through an array and call the same method for each button instance. So instead of hardcoding this:
sections_mc.section**2**.alphaTo(10,.5,"easeoutquad");
sections_mc.section**3**.alphaTo(10,.5,"easeoutquad");
sections_mc.section**4**.alphaTo(10,.5,"easeoutquad");
sections_mc.section**5**.alphaTo(10,.5,"easeoutquad");
sections_mc.section**6**.alphaTo(10,.5,"easeoutquad");
I can use something like this:
for (i=0; i < sectionArray.length; i++) {
sections_mc.section + **sectionArray*** + .alphaTo(10,.5,"easeoutquad");
}
I tried various things like concatenating the command and using eval:
eval("sections_mc.section" + sectionArray* + '.alphaTo(10,.5,"easeoutquad");';
However, none of my efforts worked.
Please could somebody help me?