Hi everyone, could anyone please help me.
I’m using this code
_root.onEnterFrame = functions;
score=0
function functions() {
for (i = 1; i<=14; i++) {
if (fly.hitTest(_root["coin"+i])) {
_root["coin"+i].play();
score++;
}
}
}
It works ok. So I can have as many coins on stage as I want, as long as each one is named?
coin1
coin2
coin3
coin4
and so and so on…
I have named each coin like this all the way up to coin20.
BUT my problem is, only coin1 to coin 14 works. The rest dont hit test with the fly. Why does that happen!?
Surely, they would all work as long as the coins are named properly, but it doesn’t.
Please can someone help me out here, why is this happening? Could someone either fix the problem or offer alternative code that works.
Thank yo very much.