Error 1084 sends me to the beginning of my code?
So i keep getting an error telling me im missing a brace at the end of my program;
"Scene 1, Layer 'Layer_1', Frame 1 1084: Syntax error: expecting rightbrace before end of program."
and when i try to go to the source it just sends me to the very start of my code.
(closer to the bottom you'll see a line of code that looks like it went to the next line for no reason, that's not actually how it shows when in actions panel, it's just wrapped around because there's no horizontal scrolling here.)
import flash.events.Event;
var moveSpeedX: int = 0;
var moveSpeedY: int = 0;
var boundaryState: int = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyup);
stage.addEventListener(Event.ENTER_FRAME, gameloop);
function keydown(e: KeyboardEvent) {
if (e.keyCode == Keyboard.LEFT) {
moveSpeedX = -5;
}
if (e.keyCode == Keyboard.UP) {
moveSpeedY = -5;
}
if (e.keyCode == Keyboard.RIGHT) {
moveSpeedX = 5;
}
if (e.keyCode == Keyboard.DOWN) {
moveSpeedY = 5;
}
}
function keyup(e: KeyboardEvent) {
if (e.keyCode == Keyboard.LEFT) {
moveSpeedX = 0;
}
if (e.keyCode == Keyboard.UP) {
moveSpeedY = 0;
}
if (e.keyCode == Keyboard.DOWN) {
moveSpeedY = 0;
}
if (e.keyCode == Keyboard.RIGHT) {
moveSpeedX = 0;
}
}
function gameloop(e:Event) {
movement();
boundaries();
displayHP();
detecthit();
}
function movement() {
player.y += moveSpeedY;
player.x += moveSpeedX;
}
function boundaries() {
if (boundaryState == 0) {
if (player.y >= 295) {
player.y = 295;
}
if (player.y <= 201) {
player.y = 201;
}
if (player.x >= 322) {
player.x = 322;
}
if (player.x <= 228) {
player.x = 228;
}
}
if (boundaryState == 1) {
var boundarytimer1: Timer = new Timer(15, 40);
boundarytimer1.addEventListener(TimerEvent.TIMER, boundaryfunction1); /*this isn't on a new line, it's just wrapped around due to the
limitations of the code sample's box.*/
boundarytimer1.start();
function boundaryfunction1(event: TimerEvent) {
boundary.scaleX += 0.05;
}
removeEventListener(TimerEvent.TIMER, boundaryfunction1);
if (player.y >= 295) {
player.y = 295;
}
if (player.y <= 201) {
player.y = 201;
}
if (player.x >= 436) {
player.x = 436;
}
if (player.x <= 111) {
player.x = 111;
}
}
}