Skip to main content
alexp59104682
Participant
March 17, 2016
Question

Need Help Fixing an Error in Action Script Code

  • March 17, 2016
  • 1 reply
  • 303 views

I create this code in an action script file and when I go to test it to see if it worked it throws this error in my face, 1078: Label must be a simple identifier.  it gives me this for line 2 and line 3.  I've tried googling a fix for this but i've found nothing that helps. Any change i make still results in the same error. What am I doing wrong here?

here's the code

package  {

  imporProxy-Connection: keep-alive

  Cache-Control: max-age=0

  flash.display.MovieClip;

  import flash.events.*;

  public class Turret extends MovieClip{

  private var _root:MovieClip;

  public function Turret() {

  // constructor code

  this.addEventListener(Event.ADDED, beginClass);

  this.addEventListener(Event.ENTER_FRAME, eFrameEvents);

  }

  private function beginClass(e:Event):void{

  _root = MovieClip(root);

  this.graphics.beginFill(0x999999);

  this.graphics.drawCircle(0,0,12.5);

  this.graphics.endFill();

  this.graphics.beginFill(0xFFFFFF);

  this.graphics.drawRect(-2.5,0,5,20);

  this.graphics.endFill();

  }

  private function eFrameEvents(e:Event):void{

  if(_root.gameOver){

  this.removeEventListener(Event.ENTER_FRAME, eFrameEvents);

  MovieClip(this.parent).removeChild(this);

  }

  }

  }

}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 17, 2016

you can't use a dash unless you mean to indicate a subtraction operation.