Related classes

[COLOR=black][FONT=Verdana]I have two classes: one that builds a menu (state.as) and the other that resizes an object so that it is vertically on the center of the stage and has the stage width (myStage.as)[/FONT][/COLOR]
[COLOR=black][FONT=Verdana] [/FONT][/COLOR]
[COLOR=black][FONT=Verdana]myStage has a parameter that is the object you want to resize:[/FONT][/COLOR]
[COLOR=black][FONT=Verdana] [/FONT][/COLOR]
[COLOR=black][FONT=Verdana]var mystage:myStage = new myStage(backround);[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]When clicking one button of the menu, the background disappears (background.visible=false) .[/FONT][/COLOR]
[COLOR=black][FONT=Verdana] [/FONT][/COLOR]
[COLOR=black][FONT=Verdana]One class (state) has an effect over the other (myStage) when the background visibility is turned to false.[/FONT][/COLOR]
[COLOR=black][FONT=Verdana] [/FONT][/COLOR]
[COLOR=black][FONT=Verdana]What I did is to load a variable “mystage” belonging to the class myStage in the class “state”. In the class “state” are the buttons. So when you click a button, the backround.visible=false[/FONT][/COLOR]
[COLOR=black][FONT=Verdana] [/FONT][/COLOR]
[COLOR=black][FONT=Verdana]It doesn’t work. I throws an error: [FONT=Verdana]error[/FONT] #[FONT=Verdana]1009[/FONT]:[FONT=Verdana]Cannot access a property or method of a null object reference.[/FONT][/FONT][/COLOR]
[COLOR=black][FONT=Verdana][FONT=Verdana][/FONT][/FONT][/COLOR]
[COLOR=black][FONT=Verdana][FONT=Verdana]thank you.[/FONT][/FONT][/COLOR]