Each buttons shall have a AS3 code, doing something.
Instead of writing the same code for every buttons, I want to
make a "for" loop and activate eventhandler for button1 - up to
button4. But something goes wrong, can someone please take a look.
Heres my code:
Simply in terms of good coding practice, move the actual
function handlers outside of your for loop. All the for loop needs
to do is add the event listeners themselves. Redeclaring the
functions X times is just a waste of resources. As long as you make
the change that kglad suggested first, you'll be in great