• 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 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

In the image "01"

I want the number from highlighted textbox to the highlighted textbox in image"02

 

this is my code.

 

 

stop();
var total: int = 0;

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

opt02.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_4);

function fl_MouseClickHandler_4(event: MouseEvent): void {
total = total - 2;
totaltext.text = total.toString();

opt02.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_4);
}

opt03.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_5);

function fl_MouseClickHandler_5(event: MouseEvent): void {
total = total - 2;
totaltext.text = total.toString();
opt03.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_5);

}

opt04.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_6);

function fl_MouseClickHandler_6(event: MouseEvent): void {
total = total - 2;
totaltext.text = total.toString();

opt04.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_6);
}


//---------------------------------------------------------------------------//


opt0201.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_7);

function fl_MouseClickHandler_7(event: MouseEvent): void {
total = total - 2;
totaltext.text = total.toString();

opt0201.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_7);

}


opt0202.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_8);

function fl_MouseClickHandler_8(event: MouseEvent): void {
total = total - 2;
totaltext.text = total.toString();

opt0202.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_8);

}


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);

}


opt0204.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_9);

function fl_MouseClickHandler_9(event: MouseEvent): void {
total = total - 2;
totaltext.text = total.toString();

opt0204.removeEventListener(MouseEvent.CLICK, fl_MouseClickHandler_9);
}


next.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);

function fl_MouseClickHandler_3(event: MouseEvent): void {
if (total >= 13) {
gotoAndStop(2);
} else if (total < 13) {
gotoAndStop(3);
}
else {
trace("Complete All Questions")
}
}

Views

503

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 04, 2022 Mar 04, 2022

Copy link to clipboard

Copied

unless your stage height is 1200px or greater, lower the font size in totaltext if you're not seeing the text update prior to clicking the next button..  ie, 73pt is a large font size.

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 05, 2022 Mar 05, 2022

Copy link to clipboard

Copied

thanks...

but can you please help me in one more thing

i do not know why this error appearing i tried everything and im feeling helpless now.

please help me.

 

why my frame 2 and frame 3 button showing error.

im sharing my FLA file it is (AIR for desktop file).

 

https://drive.google.com/file/d/1xRSMw__igtqbUhsTt89qwKYlDhisDWTh/view

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 05, 2022 Mar 05, 2022

Copy link to clipboard

Copied

i don't download and correct files, unless i'm hired.

 

that said, i did view your attached images and don't see reloaD01 or reloadD02 in your code, but it must be some where.

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 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

they are in frame 2 and frame 3...

but please help me....i cant figure it out.

 

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 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

LATEST

the error is in those other frames and there's nothing about that in this forum.

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