I don't think that my document class is unattached; I ran a few trace statements, and found that everything was working, expect for the fact that Flash wouldn't actually draw the MovieClip object. The document class, my menuHandler Class (I set up a class to handle all of the menu screens; drawing them, and setting them to null once I'm done with them), and my first screen, (the Main Menu)-- all of them ran their constructor functions. The system was working fine until I added a GameLevelHandler (a class that would handle the level select screen and the screens nearby, like achievements, stats, shops, that sort of thing), using an Event called NavigationEvent to deal with menu navigation, GameNavigationEvent to deal with level screen navigation, and GameEvent to deal with going between the menu, the level select screen, and later, a class that dealt with toolbars and pulldown windows. The following is my document class.
package {
import flash.display.MovieClip;
public class DocumentClass extends MovieClip {
public var menuHandler:MenuHandler;
public var gameLevelHandler:GameLevelHandler;
public function DocumentClass() {
menuHandler = new MenuHandler();
menuHandler.addEventListener(GameEvent.GAMESTART, onGameStart);
}
public function onGameStart(gameEvent:GameEvent):void {
gameLevelHandler = new GameLevelHandler();
gameLevelHandler.addEventListener(GameEvent.GAMEBACKTOMENU, onGameBackMenu);
menuHandler = null;
}
public function onGameBackMenu(gameEvent:GameEvent):void {
menuHandler = new MenuHandler();
menuHandler.addEventListener(GameEvent.GAMESTART, onGameStart);
gameLevelHandler = null;
}
}
}
I'm going to have this problem solved in a while anyway, so if you think it's probably some problem that you can't solve because of lack of information, I'll solve it on my own. But if anything jumps out a t you, let me know please.
P.S. For some reason, in a different game I was making, the Timer instance I was using for the game Timer was saying it didn't want an input variable for the constructor, whereas I had been informed that a "25" for 25 milliseconds was what was supposed to go in...? I don't think anything happened to t he Timer class, so if you know what might have hapened, lplease let me know as well. It kind of forced me to abandon the project...
☺
P.S.
Now I feel kind of stupid. I forgot to add the "addChild" statement...
yeah.