I’m cleaning up my code and I decided to try my hand at using an array for buttons but when I try to assign an event listener I can’t figure out a way to call different functions without starting another array or making more redundant code. I’m sure there’s a simpler way to do this. Any suggestions?
.
_test[0] = _buttonsItem.ffBtn;
_test[1] = _buttonsItem.pauseBtn;
_test[2] = _buttonsItem.playBtn;
_test[3] = _buttonsItem.rewindBtn;
_test[4] = _buttonsItem.soundBtn;
_test[5] = _buttonsItem.stopBtn;
_test[6] = _videoBackg;
for (var i=0;i<_test.length;i++){
_test*.buttonMode=true;
_test*.addEventListener(MouseEvent.CLICK,#### Some kind of dynamic _test* function calling ####);
}
.
I’m new to AS3 so please be patient if this seems like an obvious solution.