Movie Clip Buttons & Dambusters
Hellote. I am a self-taught Flash developer and am learning ActionScript 2. Whilst programming a game known as "Dambusters", I encountered one of many problems with my amateur script. Most of them could be resolved, with I'm sure many flaws, but this snip of code doesn't seem to have anything wrong with it, and yet, it still fails to proceed the way I want it to.
In this game, or at least the prototype, a random brick on a field of 9 bricks (brick1, brick2, brick3...) within the movieclip "level_mc" will burst (or turn blue), and turn into the movieclip "burst_mc". One must click that movie clip to make gotoAndStop the frame in which it is once again neutral and waiting for the next burst. When the mouse rolls over the movieclip, the cursor becomes a hand, like it is supposed to, so I know some of this code is working, but when I click, it does not reset to "neutral."
function testForBrickFix()
{
var i = 1;
while (i <= 9)
{
eval("level_mc.brick" + i + ".burst_mc").onRelease = function ()
{
eval("level_mc.brick" + i).gotoAndStop("neutral");
};
++i;
} // end of while
} // Function ended
I'm hoping I can get some help and recommendations on this. I'll post more code to give other users an understanding if necessary.