Popping bubble wrap HitTest

Hi, thank you all for the good tips :slight_smile: they helped me go forward in my project!

I’m working on this not-new-idea of bursting bubble warp. I figured it’s a good way of learning . But I’m missing something and can’t quite figure it out.

I have a movie clip called “button_mc” that has the 3 states of the bubble:
-A starting state “_up”,
-Cracking the bubble “_down” ( because this one has the popping sound);

  • and cracked “_downQuiet” ( the same without the noise) .

I would like to be able to pop the bubbles with the mouse click and stay popped.
I found this code that works ( thanks guys for the hitTest tutorial!):

onMouseDown= function () {
mx=_xmouse;
my=_ymouse;
if (button_mc.hitTest(mx, my)) {
button_mc.gotoAndPlay("_down");
}
}

BUT… if i click again on top it replays the _down with sound… which is not the idea because the bubble is already popped.
So i tried to add and “else”. but it didn’t work :S

onMouseDown= function () {
mx=_xmouse;
my=_ymouse;
if (button_mc.hitTest(mx, my)) {
button_mc.gotoAndPlay("_down");
}
else {gotoAndPlay("_downQuiet");
}

}

What am I doing wrong? Some help would be appreciated.

Plus one more thing. I wanted to go real pro and make 4 or 5 kinds so it gives a realistic effect But 4 or 5 wont be enough to fill the scene. Would i have to duplicate the MC’s, change the name and make a separate code for each bubble? I guess this shows that I’m a newbie.

Thanks already for the help!!