Repeat function for duplicate movieclip help please

In my game, I have a button (fireBtn) that duplicates a movieclip of a fire.  I also have a button of water (waterBtn), which turns off the fire and remove the movieclip (s) dual fire.   Finally, there is a button 'Reset' (reset_mc) which removes the movieclip (s) on double fire and resets all other players.  Here is the code:

Creates the fire


{fireBtn.onPress = function ()}
i ++ ;
_root.fireMC.duplicateMovieClip ("fireMC" + I, i);
}

{waterBtn.onRelease = function ()}
waterBtn._visible = false;
}

Fades and deletes the fire


waterBtn.onPress = fadeOut;

function fadeOut() {}
fireMC1.onEnterFrame = function() {}
If (this ._alpha > = 0) {}
This ._alpha-= 5;
If (this ._alpha > = 100 | this ._alpha < = 0) {}
for (var j: Number = 0; j < = i; j ++) {}
{if (TL ["fireMC" + j])}
TL ["fireMC" + j] .removeMovieClip ();
}
}
}
}}}

Also removes fire and restores the waterBtn


{reset_mc.onRelease = Function ()}
waterBtn._visible = true;
for (var j: Number = 0; j < = i; j ++) {if (tl ["fireMC" + j]) {}
TL ["fireMC" + j] .removeMovieClip ();
}
}

It works fine the first time, but after using the reset double created fire fade or remove.  I think it has something to do with the designation of the movieclips in double (12th line of code).  I would like duplicated fires to always fade no matter how many times reset you but I don't have a clue as to how to code it.  I hope this makes sense.  Any help would be appreciated. Thanks in advance.

Try

{reset_mc.onRelease = Function ()}

waterBtn._visible = true;

for (var j: Number = 0; j<>

TL ["fireMC" + j] .removeMovieClip ();

}

i = 0; //<----- reset ="">

}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Drawing s combined arc introduced into canvas?

    Hello I'm working on an HTML5 canvas game, where some areas need to be stretched connceted in sort of a "blob" of circles. The code to draw using im looks like this, and an example can be found on github: https://github.com/JRIE/connect The error is

  • Satellite X 200-can I set my FSB 667 t5450 at a FSB 800 t7100?

    I'm not finding much about the specifications of the mobo and the capacity to my X 200 - FG1. The 1.66 GHz cpu isn't great and I would like to ask in a T7100 1.8 / 2 m / 800 I have the laptop of the other party. I can't find info on the question if t

  • Adding icloud email eprint

    You are trying to add my icloud email eprint but do not know what parameters to useCalled apple and they suggest that I have contact HP

  • DeskJet 3845 trouble

    My DeskJet 3845 has stopped working.   When you try to print, I get a message... "is in error state".   I replaced the color and the blackcartidges but without result.   Ditto with the re-boot and remove and then reinstall the device.   My devices of

  • What is the best way to stream from one Panel to the next?

    I am writing a LabVIEW application that uses two monitors of different sizes on the same computer. I have to listen to four data channels of 100 Hz for a main VI to its front panel as a second front on another monitor. My options: 1. the easiest way