Accessing document class property from another class

I’m making a murder mystery game.

The Main.as file will have all of the game logic, such as the mysteryNumber.

The other actionScript files represent rooms that the user may click and depending on the ‘mysteryNumber’, it will execute the 1 of 6 scenarios.

So for example, if a user clicks the Library page, the LibPage.as will call the ‘mysteryNumber’ and execute some code to display on the library page.

It will be the same for the other 4 rooms.

The problem I have is that the LibPage.as won’t call the ‘theNumber’ property from Main.as Please help.

Here’s the Main.as

package
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    
    public class Main extends MovieClip
    {
        var mapPage:MapPage;
        var essenPage:EssenPage;
        var libPage:LibPage;
        var mungosPage:MungosPage;
        public var theNumber:Number;
        
        public function Main()
        {
            mapPage = new MapPage;
            essenPage = new EssenPage;
            libPage = new LibPage();
            libPage.mysteryNumber = this;
            mungosPage = new MungosPage;
            addChild(libPage);
            mysteryNumber();
            
            mapPage.essenButton.addEventListener(MouseEvent.CLICK,
                onEssenButtonClick);
            mapPage.libButton.addEventListener(MouseEvent.CLICK,
                onLibButtonClick);
            mapPage.mungosButton.addEventListener(MouseEvent.CLICK,
                onMungosButtonClick);

            libPage.mapButton.addEventListener(MouseEvent.CLICK,
                onMapButtonClick);
        }
        
        private function mysteryNumber():void
        {
            theNumber = Math.ceil(Math.random() * 1);
        }
        
        function onEssenButtonClick(event:MouseEvent):void
        {
            addChild(essenPage);
            removeChild(mapPage);
        }
        function onLibButtonClick(event:MouseEvent):void
        {
            addChild(libPage);
            removeChild(mapPage);
        }
        function onMungosButtonClick(event:MouseEvent):void
        {
            addChild(mungosPage);
            removeChild(mapPage);
        }
        function onMapButtonClick(event:MouseEvent):void
        {
            addChild(mapPage);
            removeChild(libPage);
        }
    }
}

and here’s the libPage.as

package
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    
    public class LibPage extends MovieClip
    {
        public var mysteryNumber:Main;
        
        private function useMysteryNumber():void
        {
          [COLOR=Red][COLOR=#000000][FONT=Times New Roman][LEFT][FONT=Courier New][COLOR=#0066CC]trace[/COLOR][COLOR=#66CC66]([/COLOR]mysteryNumber.[COLOR=#006600]theNumber[/COLOR][COLOR=#66CC66])[/COLOR];[/FONT][/LEFT][/FONT][/COLOR][/COLOR]
        }
    }
}