Nested button inside MovieClips

I am sure I must be doing something very stupid but here goes:

This is for a navigation bar.

  • I have a main movie (mcMenu) on my stage which holds all the main buttons (btnHome, btnAbout, etc…).
  • Inside mcMenu, when I roll over say btnAbout, the movie plays from 10 to 20th frames during which time a submenu fades into view.
  • Inside this submenu, I have the sub-section buttons. It is these buttons that I am having problems with. Basically, I can’t get them to respond to onRelease events.

What could I be doing wrong?

Thanks.

What code are you using on the sub buttons?

:hr:

I would guess that the problem lies in your pathing. When using event handlers on nested MC’s you must either use _root to access the main timeline and continue your path from there or _parent to access the MC that’s holding the sub-select buttons depending on what you’re trying to do.

Thanks monkeyfresh and lunatic…

Well the code I have on the button is a pretty simple onRelease code for changing URL of the browser (this is all a navigation bar for a website).
The code is (on the first frame of the submenu’s 1st layer):

subBtn1.onRelease = function():Void {
   getURL("someurl");
}

So the structure is like this:
Stage 
 |
 ----  Main_Menu_MC
        |
        ---- Main_Menu_Btns
        |
        ---- SubMenu_MCs
              |
              ----Sub_Menu_Btns (like subBtn1 above)

So, I am not accessing any MC higher up or anything from the nested submenu MC which holds these submenu buttons.

Make sure you use the whole path if you are using getURL to go to a website. Include the http://www - the whole bit.

If that doesn’t do it post again!

:hr:

Thanks for the reply. No, that does not do it. Actually any code inside the onRelease button does nothing, including a simple ‘trace’ command.

[AS]subBtn1.onRelease = function():Void {
_root.getURL(“http://www.siteName.com”,"_self");
}[/AS]This should work.

Thanks Wizard.
I figured out what the root of my problem was. ALthough I don’t know how to remmedy it totally. See I wanted to have a rollout effect on the submenus, so that when you rolled out of any submenu, the play would move to the first frame of the main movie. So on the frame that I had a submenu come up, I added a code like this:



mcAbout_submenu.onRollOut = function():Void {
	gotoAndStop("start");
}


Now, if I take out this bit of code, the buttons inside the submenu work! What I am doing wrong guys? And sorry for not explaining everything…

The file is here: http://raheel.saebaan.com/iama_menu_nav.fla