I am on my second big AS3 project and I need a better way of adding Display Objects to the main stage from within other classes.
I have my Main.as which starts everything off and is an extension of MovieClip. I have a LevelManager class which I have to load levels, track level progress, and switch between other levels of my game.
I have a Level class which has partly the duty of populating the assets to the screen for that level of the game. However, I can’t just add them to the stage like I can in the Main class. (obviously)
My previous solution was to pass an instance of Main’s stage through multiple classes until it got to the one who’s job it was to populate display objects. It still makes me cringe. There has to be a better way. Any help?