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

Need Help Fixing an Error in Action Script Code

New Here ,
Mar 17, 2016 Mar 17, 2016

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);

  }

  }

  }

}

TOPICS
ActionScript
292
Translate
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 ,
Mar 17, 2016 Mar 17, 2016
LATEST

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

Translate
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