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

Error code in ActionScript 3.0

New Here ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

I'm using adobe animate in making my 10 page quiz for my requirement in class. 

And i already did my first page. But my problem goes to my 2nd page
I don't know what went wrong to my Action script. 

Scene 1, Layer 'AS_txt', Frame 2 1084: Syntax error: expecting rightbrace before end of program.

Here's my coding:

var score:Number = 0;
score_inst.text=String(score);

stop();


submit2_inst.addEventListener(MouseEvent.CLICK, checkanswer);

function checkanswer(event:MouseEvent):void
{
if(String(answer2_inst.text).toLowerCase() == "yeonjun")
{
result2_inst.text= "CORRECT"
score++;
score2_inst.text=String(score);

}
else
{
result2_inst.text="INCORRECT";
score2_inst.text=String(score);
}

 

send help pls 

TOPICS
ActionScript , Code , Error , How to

Views

80

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 ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

LATEST

Hi.

 

You're missing a closing curly brace in the checkAnswer function.

 

It should be:

// ...
{
result2_inst.text="INCORRECT";
score2_inst.text=String(score);
}
} // this rightbrace is missing

 

I hope it helps.

 

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