# Menu is working, but there is Errors

**URL:** <https://forum.kirupa.com/t/menu-is-working-but-there-is-errors/282447>\
**Category:** Uncategorized\
**Created:** [February 22, 2009, 7:29am UTC](https://forum.kirupa.com/t/menu-is-working-but-there-is-errors/282447 "2009-02-22T07:29:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smallDot](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@smallDot](https://forum.kirupa.com/u/smallDot)\
**Post date:** [February 22, 2009, 7:29am UTC](https://forum.kirupa.com/t/menu-is-working-but-there-is-errors/282447/1 "2009-02-22T07:29:24Z")

</div>

i have menu on main time line with "menu\_mc)  
it is animation tween so:

- frame one there is stop()
- when over, it plays untill frame 30, so the user can click the sub buttons
- when out, it plays and stop at frame 1

these errors are:  
**1- the following error appears when i load another swf**  
ReferenceError: Error #1065: Variable event is not defined.  
at ELI\_fla::MainTimeline/loadSection()  
at section1\_fla::MainTimeline/frame147()

**2- The following error appears when i click any where after the next swf loaded**  
TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at com.leebrimelow.ui::ScrollBar/thumbUp()

```auto

menu_mc.main_btn.addEventListener(MouseEvent.CLICK, openMenu);
function openMenu(e:MouseEvent):void {
    menu_mc.gotoAndPlay("over");
}

var currMovie:String = "section1";
var containerLoader:Loader = new Loader();
containerLoader.load(new URLRequest(currMovie+".swf"));
container.addChild(containerLoader);

menu_mc.b1_btn.addEventListener(MouseEvent.CLICK,function(){secClicked("section1");});
menu_mc.b2_btn.addEventListener(MouseEvent.CLICK,function(){secClicked("section2");});
menu_mc.b3_btn.addEventListener(MouseEvent.CLICK,function(){secClicked("section3");});
menu_mc.b4_btn.addEventListener(MouseEvent.CLICK,function(){secClicked("section4");});

function secClicked(secStr:String) {
    if (currMovie != secStr) {
        if (containerLoader.content.currentFrame >= containerLoader.content.midframe) {
            currMovie = secStr;
            containerLoader.content.play();
        }
    }
}

function loadSection() {
    containerLoader.unload();
    containerLoader.load(new URLRequest(currMovie+".swf"));
    event.target.mouseEnabled = false;
}

```

this code is inside the menu\_mc, so the user when roll out it plays to roll out the sub menu.

```auto

stop()
inv_btn.addEventListener(MouseEvent.ROLL_OVER, closeMenu)
function closeMenu(e:MouseEvent):void{
    gotoAndPlay("out")
}

```

please help to fix these errors
