Skip to main content
Inspiring
April 26, 2022
Answered

Syntax error: expecting rightbrace before end of program.

  • April 26, 2022
  • 2 replies
  • 292 views

I'm getting the error in the header inside this function

 

import flash.system.fscommand;
import flash.events.MouseEvent;

restartBtn.addEventListener(MouseEvent.CLICK, restartGame);
quitBtn.addEventListener(MouseEvent.CLICK, exitGame);

function restartGame(event:MouseEvent):void {
	MovieClip(root).deathScreen.x = 1000;
	MovieClip(root).deathScreen.y = 0;

	MovieClip(root).restartBtn.x = 1000;
	MovieClip(root).restartBtn.y = 0;


	MovieClip(root).quitBtn.x = 1000;
	MovieClip(root).quitBtn.y = 0;
	
	MovieClip(this.root).gotoAndPlay(1, "Scene 1");
}

function exitGame(event:MouseEvent):void {
	fscommand("quit");
	System.exit(0);
}

 

to my knowledge nothing was changed since last working copy, any insight would be helpful

This topic has been closed for replies.
Correct answer ForestSystem

error was on another file but trace back to that code file shown. 

 

2 replies

ForestSystemAuthorCorrect answer
Inspiring
May 2, 2022

error was on another file but trace back to that code file shown. 

 

JoãoCésar17023019
Community Expert
Community Expert
April 26, 2022

Hi.

 

Your code seems correct to me. Is it complete?

 

Which frame or line does the error come from?

 

Please let us know.

 

Regards,

JC