Answered
Actionscript 3 Button that counts clicks
I know I am a total noob to flash, but is there a way to make a button that has a number that goes up each time you click it in actionscript 3? If so please HELP ME!!!
I know I am a total noob to flash, but is there a way to make a button that has a number that goes up each time you click it in actionscript 3? If so please HELP ME!!!
If you created a button and assigned it an instance name "btn", the following code will do what you ask...
var clickCount:int = 0;
btn.addEventListener(MouseEvent.CLICK, addClick);
function addClick(evt:MouseEvent):void {
clickCount++;
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.