0

Hi so I'm making a main menu and the problem I've run into is regarding a back button. I'm using the same back button to navigate throughout the submenus of the main menu.

I need to know how to determine which submenu of the menu is up at any given time, so that I can change my playhead to the appropriate label instead of going back to the original main menu label all the time.

    var subMenu:DisplayObject = this.getChildByName("mc_subMultiplayer");
    if (Boolean(this.contains(subMenu))){
        this.gotoAndPlay(49);
    }
    else{
        MovieClip(parent).gotoAndPlay("goBack");
    }

I've tried variations of this to no avail :c

1 Answers1

1

I think you would need to manually keep track of what menu the user is on and react accordingly. You could do this a few ways, such as hard coding for every single sub menu which parent menu to go back (not recommended) or keeping a list or stack of menu buttons the user has pressed to create a 'trail' you can backtrack, or maybe just keep track of some menu ids (same idea, but keeping track of menus instead of button presses, which may be more cleaner and intuitive).

mitim
  • 3,169
  • 5
  • 21
  • 25
  • I was trying to avoid keeping table of menu ids to reference, I figured there'd be some stage function call to keep track of the currently playing MC or something along those lines. No luck yet though. I may just end up going with menu ids, thanks! – user2063135 Feb 12 '13 at 00:40
  • Hm, maybe. It might work if you are just adding new menu clips over top and as a parent to the existing menu? Or just appending them to the display stack then tracing the display object index. Though this would depend strongly on how you are manipulating the display stack. It may get messy as well as introduce a level of dependency on the display stack and confusion (if you have to edit) later on that you may not want. The old menus on the display stack may eat up processing power as well. – mitim Feb 12 '13 at 01:12