title: What happens first, MovieClip.onLoad() or Event.ENTER_FRAME?
body: <p>I'm making a small game in Flash as a school project, and I was wondering what would trigger first when a movie clip is placed-- the onLoad function, or the ENTER_FRAME event.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>EDIT: I removed onLoad, because it isn't actually called when the object is put on the stage.</p>
  
  <pre><code>var loaded:Boolean = false;
  var angle:Number = 0; //in radians
  this.addEventListener(Event.ENTER_FRAME, update);
  function init():void {
      //get projectile position based on relation to mouse and spawning point.
      trace("init");
      loaded = true;
      this.angle = Math.atan2(mouseY - this.y, mouseX - this.x);
  }
  function update(e:Event):void {
      /* TRIG TIME! Move the object a certain amount
       * of pixels-- based on the delta, in the specified angle.
       */
      if (!loaded) {
          init();
      }
      trace("update");
      var slope:Number = Math.tan(angle);
  }
  </code></pre>
  
  <p>This method still probably doesn't work, though...</p>