# A stage problem

**URL:** <https://forum.kirupa.com/t/a-stage-problem/323587>\
**Category:** flash\
**Created:** [July 8, 2011, 7:36am UTC](https://forum.kirupa.com/t/a-stage-problem/323587 "2011-07-08T07:36:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smacks](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@smacks](https://forum.kirupa.com/u/smacks)\
**Post date:** [July 8, 2011, 7:36am UTC](https://forum.kirupa.com/t/a-stage-problem/323587/1 "2011-07-08T07:36:10Z")

</div>

Hello!

My problem is kinda strange, I was testing a way to set a Menu before my Setup class wich load the game (was starting fine before).  
After those test i choosed to reset my Setup class right at the start of the swf for not to have the Menu interferring while i’m developping.

Now when i launch I get a “\*TypeError: Error #1009: Cannot access a property or method of a null object reference”

Quite usual, but this error occure when i use the stage in those 2 lines  
stage.addEventListener(KeyboardEvent.KEY\_DOWN,keyDown);  
stage.addEventListener(KeyboardEvent.KEY\_UP, keyUp);

Of course i’ve imported Stage class like this:  
import flash.display.Stage;

So all my game launch, background, ships, ennemyspawn… but i can’t get keyboards input wich worked fine before with the same configuration and it looks like because the stage is null.  
Where’s the poop?

Max

-
