I have a health pack connected to a parachute and after 15 seconds it falls and the hero can pick it up and restore health. The parachute and health pack are inside the same clip and the following timer code is on the first frame inside the mc.
Code:
stop();
this._visible =false;
function wait() {
this._visible = true;
gotoAndPlay(2);
clearInterval(myTimer);
}
myTimer = setInterval(wait, 15000);
On frame 2, I have a tween of the parachute and healthpack slowly falling to the Earth. On the last frame I have this code:
Code:
stop();
if (this.hitTest(_root.character)) { gotoAndPlay(1); health +=1; }
After 15 seconds, the clip becomes visible and it falls to the ground like normally. However my character gains health, but the clip does not go back to the first frame again. How can I make it so that when the character touches it, the health pack will disappear for another 15 seconds and the character will gain only 1 health.