title: AS3 - Event.ENTER_FRAME - error 1119
body: <p>I'm trying to develop a simple game in Adobe Animate and AS3.</p>
  
  <p>I have a class <code>GameCore</code> where I want to add an ENTER_FRAME event listener.</p>
  
  <pre><code>package as3 {
  
  import flash.display.Stage;
  import flash.display.MovieClip;
  import flash.events.*;
  import as3.movieclips.RocketShip;
  
  
  public class GameCore {
  
      var rocket:RocketShip;
      var stage:Stage;
      var timeline:MovieClip;
      var i:int;
  
      public function GameCore( stage:Stage ) {
          // constructor code
          this.rocket = new RocketShip();
          this.stage = stage;
          this.timeline = this.stage as MovieClip;
          this.i = 0;
          this.stage.addEventListener(Event.ENTER_FRAME, gameLoop);
      }
  
      public function goToMainScreen():void {
          this.timeline.goToAndStop("MainScreen");
      }
  
      public function goToGameScreen():void {
          this.timeline.goToAndStop("GameScreen");
      }
  
      public function startGameLoop():void {
  
      }
  
      public function gameLoop(event:Event){
          trace(this.i);
          this.i += 1;
      }
  
  }
  
  }
  </code></pre>
  
  <p>When I try to execute the code on a timeline frame like so:</p>
  
  <pre><code>  import as3.GameCore;
    var game:GameCore = new GameCore(stage);
  </code></pre>
  
  <p>It throws an error saying:</p>
  
  <pre><code> Can´t access probably undefined property ENTER_FRAME referenced with static type Class
  </code></pre>
  
  <p>i did this before, but i don't touch as3 for a couple of years, can you tell me whats going wrong here?</p>
  
  <p>Thanks in advance and happy programming!</p>