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

AS3 Project Error: 1087: Syntax error: Extra characters found...

New Here ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

Hello,

 

I'm using Adobe Animate 2018 to make a small platformer game to keep myself entertained when I'm bored.

 

Everything was alright, until I tried to add new levels. Whenever I run my game, it says this:

1087: Syntax error: Extra characters found after end of program.

 

It shows the error in another location, but here's the whole code including the problem area:

 

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);

if(e.keyCode == Keyboard.DOWN) ; {
downPressed = true;
if(doorOpen && player.hitTestObject(back.other.lockedDoor)){
nextLevel();
}
}

if(e.keyCode == Keyboard.RIGHT){
rightPressed = true;
}

if(e.keyCode == Keyboard.UP){
upPressed = true;
}

if(e.keyCode == Keyboard.DOWN){
downPressed = true;
}
}

TOPICS
ActionScript , Code , Error , How to

Views

588

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

correct answers 1 Correct answer

Community Expert , Apr 06, 2021 Apr 06, 2021

Hi.

 

It's probably because you have an extra semicolon in this if statement:

if(e.keyCode == Keyboard.DOWN) ; {

 

Just remove it and the error may go away.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

Hi.

 

It's probably because you have an extra semicolon in this if statement:

if(e.keyCode == Keyboard.DOWN) ; {

 

Just remove it and the error may go away.

 

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
New Here ,
Jun 13, 2021 Jun 13, 2021

Copy link to clipboard

Copied

Thank you very much! Even though I found another way of going to another level, thanks for the tip! 🙂

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
Community Expert ,
Jun 14, 2021 Jun 14, 2021

Copy link to clipboard

Copied

LATEST

Great! You're welcome!

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
Community Expert ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

Actually, you also have an extra curly brace in the end. If you remove it you should be good to go.

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