Skip to main content
Known Participant
June 16, 2010
Answered

Need help on click count button thing!

  • June 16, 2010
  • 1 reply
  • 539 views

Right now I have a button that whenever I click it, it adds 30 seconds  to a countdown timer.  I also want the button to keep track of clicks so  that whenever it's clicked it adds .01 to a total that starts at 0.   This is what I got of the code so far...

bidbutton.addEventListener(MouseEvent.CLICK,addTim  e);

function addTime (e:MouseEvent):void {
total_time += 30;
}


Any help would be appreciated!

This topic has been closed for replies.
Correct answer Ned Murphy

It might be as simple as what's below depending on your design....

var clicks:Number = 0;

bidbutton.addEventListener(MouseEvent.CLICK,addTim  e);

function addTime (e:MouseEvent):void {
     total_time += 30;

     clicks += 0.01;
}

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
June 16, 2010

It might be as simple as what's below depending on your design....

var clicks:Number = 0;

bidbutton.addEventListener(MouseEvent.CLICK,addTim  e);

function addTime (e:MouseEvent):void {
     total_time += 30;

     clicks += 0.01;
}

xravielxAuthor
Known Participant
June 16, 2010

I made the dynamic text box and tried it and it didn't work, it still stayed at 0 any reason why you think?

xravielxAuthor
Known Participant
June 16, 2010

Ah nevermind I got it I forgot to put instance name, but do you know how to make it so it just rounds to two decimals?