Skip to main content
Participant
July 20, 2021
Question

Error code in ActionScript 3.0

  • July 20, 2021
  • 1 reply
  • 133 views

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 

This topic has been closed for replies.

1 reply

JoãoCésar17023019
Community Expert
Community Expert
July 20, 2021

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