Highlighted

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.

Avatar

Avatar

mackenziej14390

Avatar

mackenziej14390

mackenziej14390

31-01-2016

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!";

  }

}