Skip to main content
Known Participant
Mar 2, 2022 6:40 AM UTC
Answered

Action Script 3.0

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 is closed to new replies. Start a new post to keep the conversation going.
ClayUUIDCorrect answer
Legend
Mar 2, 2022 2:22 PM UTC

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

5 replies

ClayUUIDCorrect answer
Legend
Mar 2, 2022 2:22 PM UTC

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

Translate
Known Participant
Mar 3, 2022 5:56 AM UTC

ohh god thank you so much....

 

Translate
JoãoCésar17023019
Community Expert
Community Expert
Mar 2, 2022 2:05 PM UTC

Hi.

 

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

 

Regards,

JC

Translate
Known Participant
Mar 2, 2022 11:55 AM UTC

in total im  only getting 1 instead of 10

Translate
Known Participant
Mar 2, 2022 7:14 AM UTC

right now im getting only single digit number

Translate