Hi,
I have an array example from a Flash Connection tutorial, and I’m wondering if there’s an easy way to add a bit of code to count through the user’s clicks.
What I’m trying to do is count the clicks, so that once someone has clicked on all 5 buttons, something happens.
var clipArray:Array = [home_mc, about_mc, products_mc, services_mc, contact_mc];
for (var i:int = 0; i < clipArray.length; i++) {
clipArray*.buttonMode = true;
clipArray*.addEventListener(MouseEvent.CLICK, clickHandler);
}
function clickHandler(event:MouseEvent):void {
switch (event.currentTarget) {
case home_mc :
trace("home");
break;
case about_mc :
trace("about");
break;
case products_mc :
trace("products");
break;
case services_mc :
trace("services");
break;
case contact_mc :
trace("contact");
break;
}
}
// E.g: If all five buttons are clicked, do something:
if (clipArray.length == 5) {
gotoAndStop(“WellDone”);
}
This counts the length, but not on clicks…
Any ideas? Thanks!