onLoad doesn't seem to work the way I expected it to in this case-- I solved this by changing the onLoad function to an ADDED_TO_STAGE event. I moved all of the actionscript code for the class out of the flash file, and into a separate actionscript file, and put the event listeners for event.ENTER_FRAME
and event.ADDED_TO_STAGE
events into the class' constructor, and the now entire class works like a charm.
public function Projectile() {
this.addEventListener(Event.ADDED_TO_STAGE, init);
this.addEventListener(Event.ENTER_FRAME, update);
super();
}
The function init was called before the function update, and now I can continue with my work!
Special thanks to Don for helping me solve this dilemma