Executing other AS3 class file from within a function

Hello! I’m new here, and fairly new to AS3.

I’m making a game and the main functions are close to finishing. But I’m having problems with my start screen. I’m working entirely in Flash Builder.

My users should be able to click a button to start the game. Right now I don’t have a functioning start screen yet, but initially the game started immediately with Game.as. But I now decided I want a start screen. So I made a new class file with the graphics and buttons for the start screen in the constructor function, and I added a Mouse click event listener to the button.

The game itself is in Game.as, that runs perfectly.

In the function for the mouse click event I added:


removeChild(startscherm);
var startgame:Game = new Game;
addChild(startgame);

I imported Game in this file as well.

The problem is that after removing the startscreen child (startscherm), it doesn’t load my Game.as file. The screen is empty.

I’m lost here. Any help is appreciated. Thanks!