Skip to main content
Inspiring
Apr 26, 2022 7:38 PM UTC
Answered

Syntax error: expecting rightbrace before end of program.

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 is closed to new replies. Start a new post to keep the conversation going.
ForestSystemCorrect answer
Inspiring
May 2, 2022 7:37 PM UTC

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

 

2 replies

ForestSystemAuthorCorrect answer
Inspiring
May 2, 2022 7:37 PM UTC

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

 

Translate
JoãoCésar17023019
Community Expert
Community Expert
Apr 26, 2022 9:45 PM UTC

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

Translate