• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Action Script 3.0

Explorer ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

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")
}
}

TOPICS
ActionScript , Code , How to

Views

377

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 02, 2022 Mar 02, 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.

Votes

Translate

Translate
Explorer ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

right now im getting only single digit number

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

in total im  only getting 1 instead of 10

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

Hi.

 

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

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

LATEST

ohh god thank you so much....

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines