hi all
I consider myself beying at begginer where actionscript comes to play, but i´m almost sure the following code could be simplified with a for loop or something similar. But i´ve tried and failed with no luck
What the code does is check all buttons (hex1, hex2 and so on) if they are “clicked” (if they are at frame 25). when yes, play it.
As it is the code does what is suposed to but i have 15 buttons so its a lot of code…
I have ommited some code within the onRelease that also does what its suposed to (show a particular image)
thanks in advance
this.onRelease = function() {
if (_root.hex.hex1._currentframe == 25) {
_root.hex.hex1.play();
}
if (_root.hex.hex2._currentframe == 25) {
_root.hex.hex2.play();
}
};
this is my attempt
this.onRelease = function() {
for (i=1;i<15;i++){
if (_root.hex.hex+i._currentframe == 25) {
_root.hex.hex+i.play();
}
}
};