I wanna acces multiple elements onEnterFrame by a for()
I just dunno how to. barXX_mc cannot be a var like in JavaScript (var barXX_mc = “bar0”+i+"_mc"). I am new to Flash and wonder how to do this :h:
Can somebody help me? If you need the *.fla contact me by alexander(at)dom.de
regards
Alex
/* for(i = 0; i < bars; i++) {
barXX_mc = ; // <-- ??? = "bar0"+i+"_mc" does not work, = bar01_mc is static *erks*
barXX_mc._x = space + Math.sin(rad + (0.5 + i / (bars - 1)) * Math.PI) * amp;
}*/
// The following should be replaced by the for() above
bar00_mc._x = space + Math.sin(rad + 0.5 * Math.PI) * amp;
bar01_mc._x = space + Math.sin(rad + (0.5 + 1 / (bars - 1)) * Math.PI) * amp;
bar02_mc._x = space + Math.sin(rad + (0.5 + 2 / (bars - 1)) * Math.PI) * amp;
bar03_mc._x = space + Math.sin(rad + (0.5 + 3 / (bars - 1)) * Math.PI) * amp;
bar04_mc._x = space + Math.sin(rad + (0.5 + 4 / (bars - 1)) * Math.PI) * amp;
bar05_mc._x = space + Math.sin(rad + (0.5 + 5 / (bars - 1)) * Math.PI) * amp;
bar06_mc._x = space + Math.sin(rad + (0.5 + 6 / (bars - 1)) * Math.PI) * amp;
bar07_mc._x = space + Math.sin(rad + (0.5 + 7 / (bars - 1)) * Math.PI) * amp;
bar08_mc._x = space + Math.sin(rad + (0.5 + 8 / (bars - 1)) * Math.PI) * amp;
bar09_mc._x = space + Math.sin(rad + (0.5 + 9 / (bars - 1)) * Math.PI) * amp;
bar10_mc._x = space + Math.sin(rad + (0.5 + 10 / (bars - 1)) * Math.PI) * amp;
bar11_mc._x = space + Math.sin(rad + 1.5 * Math.PI) * amp;