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

32

Likes

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
Adobe Community Professional ,
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

Likes

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