title: AS3 call to possibly undefined method
body: <p>I get a very similar problem when I uncomment the mcMain. method calls. When I try to call an instance on the stage it says "1061: Call to a possibly undefined method addEventListener through a reference with static type Class."</p>
  
  <p>I have done similar stuff before on another computer and I am not sure why this is doing this. I am Using Adobe Flash CS5.5 and AS3.0.</p>
  
  <pre><code>//These variables will note which keys are down
  //We don't need the up or down key just yet
  //but we will later
  var leftKeyDown:Boolean = false;
  var upKeyDown:Boolean = false;
  var rightKeyDown:Boolean = false;
  var downKeyDown:Boolean = false;
  //the main character's speed
  var mainSpeed:Number = 7;
  
  //adding a listener to mcMain which will make it move
  //based on the key strokes that are down
  mcMain.addEventListener(Event.ENTER_FRAME, moveChar);
  function moveChar(event:Event):void
  {
      //if certain keys are down then move the character
      if (leftKeyDown)
      {
          trace("left");
          //mcMain.x -= mainSpeed;
      }
      if (rightKeyDown)
      {
          trace("right");
          //mcMain.x += mainSpeed;
      }
      //if(upKeyDown || mainJumping){
      ////mainJump();
      //}
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/PtR7F.png" rel="nofollow">http://i.stack.imgur.com/PtR7F.png</a></p>