Skip to main content
Known Participant
March 2, 2022
Answered

Action Script 3.0

  • March 2, 2022
  • 4 replies
  • 566 views

I have a very Stupid Question,

 

how can i get 2 digit number 

 

here is my code-

 

stop();
var total:int = 00;

totaltext.text = total.toString();

opt01.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void
{
total = total +10;
totaltext.text=total.toString();

opt01.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
}

opt0203.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);

function fl_MouseClickHandler_2(event:MouseEvent):void
{
total = total +10;
totaltext.text=total.toString();

opt0203.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
}

 


next.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);

function fl_MouseClickHandler_3(event:MouseEvent):void
{
if(total == 20)
{
gotoAndStop(2);
}
else
{
trace("RETRY")
}
}

This topic has been closed for replies.
Correct answer ClayUUID

If it's only displaying one character no matter what you set it to, that's because you made your text field too small.

4 replies

ClayUUIDCorrect answer
Legend
March 2, 2022

If it's only displaying one character no matter what you set it to, that's because you made your text field too small.

Known Participant
March 3, 2022

ohh god thank you so much....

 

JoãoCésar17023019
Community Expert
Community Expert
March 2, 2022

Hi.

 

I didn't quite understand what you want to do. Can you elaborate more or give an example?

 

Regards,

JC

Known Participant
March 2, 2022

in total im  only getting 1 instead of 10

Known Participant
March 2, 2022

right now im getting only single digit number