Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Error 1084: Expecting right brace before end of program. Same error shows up on line 52 twice. Please help! I am trying to make a hexagon a circle race.

mackenziej14390
Level 1
Level 1

package  {

  import flash.display.MovieClip;

  import flash.events.Event;

  public class GameStates extends MovieClip {

  public var winnder:String;

  pulbic function GameStates() {

  // constructor code

  }

  public function sayWelcome():void {

  trace("Welcome to my game!");

  }

  public function moveNext():void {

  gotoAndStop(currentFrame + 1);

  }

  public function movePrev():void {

  gotoAndStop(currentFrame - 1);

  }

  public function startGame():void {

  addEventListener(Event.ENTER_FRAME, moveHexagon);

  addEventListener(Event.ENTER_FRAME, moveCircle);

  }

  public function moveCircle(e:Event):void {

  circle_mc.x += 10;

  if (circle_mc.x > 440) {

  removeEventListener(Event.ENTER_FRAME, moveCircle);

  removeEventListener(Event.ENTER_FRAME, moveHexagon);

  winner = "Circle";

  winner_txt.text = winner + " won the race!";

  }

  }

  public function moveHexagon(e:Event):void {

  hexagon_mc.x += 5;

  if (hexagon_mc.x > 440) {

  removeEventListener(Event.ENTER_FRAME, moveCircle);

  removeEventListener(Event.ENTER_FRAME, moveHexagon);

  winner = "Hexagon";

  winner_txt.text = + " won the race!";

  }

}

0 Replies