# Linking pages together via buttons

**URL:** <https://forum.kirupa.com/t/linking-pages-together-via-buttons/311888>\
**Category:** Uncategorized\
**Created:** [July 19, 2010, 5:06pm UTC](https://forum.kirupa.com/t/linking-pages-together-via-buttons/311888 "2010-07-19T17:06:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylan](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@taylan](https://forum.kirupa.com/u/taylan)\
**Post date:** [July 19, 2010, 5:06pm UTC](https://forum.kirupa.com/t/linking-pages-together-via-buttons/311888/1 "2010-07-19T17:06:41Z")

</div>

Hi can somebody please tell me why my 3 pages are not being brought up when i ‘ctrl enter’. I am making an online game with 3 pages - an instructions page, game screen and end game screen and do not know why my initial page is not opening.

It is sending me the error message:Error #1010: A term is undefined and has no properties.  
at MainClass$iinit()

(here is my code)

package{  
import flash.display.MovieClip;  
import flash.events.MouseEvent;

```
public class MainClass extends MovieClip{
    var instructions:Instructions;
    var gameScreen:GameScreen;
    var endGameScreen:EndGameScreen;

    public function MainClass(){
        instructions = new Instructions();
        gameScreen = new GameScreen();
        endGameScreen = new EndGameScreen();
        
        instructions.playBtn.addEventListener(MouseEvent.CLICK,gotoGame);
        gameScreen.endGameBtn.addEventListener(MouseEvent.CLICK,endGame);
        endGameScreen.playAgainBtn.addEventListener(MouseEvent.CLICK,playAgain);
        
        addChild(instructions);
    
        }
        
        private function gotoGame(evt:MouseEvent):void{
            removeChild(instructions);
            addChild(gameScreen);
            }

            private function endGame(evt:MouseEvent):void{
                removeChild(gameScreen);
                addChild(endGameScreen);
                }
                
                private function playAgain(evt:MouseEvent):void{
                    removeChild(endGameScreen);
                    addChild(instructions);
    }
}

```

}
