I'm getting the above error on this code when I try to make a bulldozer appear on the stage. It's driving me crazy, and I don't know why it's happening. I have the bulldozer clip in my library, and it seems to be correctly defined. Any help would be greatly appreciated.
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.ui.Mouse;
//START SCREEN
var startScreen: MovieClip;
var bulldozer: MovieClip;
startClick.addEventListener(MouseEvent.CLICK, startGame);
function startGame(event: MouseEvent): void {
startScreen.parent.removeChild(startScreen);
startClick.parent.removeChild(startClick);
addChild(bulldozer);
var enemyGenerator: Number = Math.random();
if (enemyGenerator >= 0.8) {
bulldozer.x = stage.x = 150;
bulldozer.y = stage.y = 150;
} else if (enemyGenerator >= 0.6) {
bulldozer.x = stage.x = 250;
bulldozer.y = stage.y = 250;
} else if (enemyGenerator >= 0.4) {
bulldozer.x = stage.x = 350;
bulldozer.y = stage.y = 350;
} else if (enemyGenerator >= 0.2) {
bulldozer.x = stage.x = 400;
bulldozer.y = stage.y = 400;
} else {
bulldozer.x = stage.x = 450;
bulldozer.y = stage.y = 450;
}
startClick.removeEventListener(MouseEvent.CLICK, startGame);
}