| Package | com.soma.model |
| Class | public class MenuManager |
Author: Romuald Quantin - www.soundstep.com
Information:
Blog page - SomaUI
How does it work - Soma Protest
Project Host - Google Code
Documentation - Soma ASDOC
Class version: 2.0
Actionscript version: 3.0
Copyright:
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and
limitations under the License.
The Original Code is Soma.
The Initial Developer of the Original Code is Romuald Quantin.
Initial Developer are Copyright (C) 2008-2009 Soundstep. All Rights Reserved.
Usage:
The MenuManager allows you to easily register and retrieve your menu class instances for later use.
The process for the Main Menu registered in the Config file (Soma.getInstance().config.menuClassName) is automatically done by Soma.
The global menu manager instance is accessible using:
Soma.getInstance().menu
Soma.getInstance().menu.getMainMenu()
var menu:MyOwnMainMenu = Soma.getInstance().menu.getMainMenu() as MyOwnMainMenu;
menu.myMethod();
Soma.getInstance().registerClass(MySecondMenuClass);
mySprite.addChild(Soma.getInstance().menu.add("MySecondMenuClass"));
See also
| Method | Defined by | ||
|---|---|---|---|
|
Creates a MenuManager instance, the global MenuManager instance is accessible using Soma.getInstance().menu.
| MenuManager | ||
|
Adds a menu to the MenuManager using its class name.
| MenuManager | ||
|
Get the main menu registered (the main menu class is the one registered in the Config class: Soma.getInstance().config.menuClassName).
| MenuManager | ||
|
Get a registered menu using its class name.
| MenuManager | ||
|
getMenus():Dictionary
Get all the menus.
| MenuManager | ||
| MenuManager | () | constructor |
public function MenuManager()Creates a MenuManager instance, the global MenuManager instance is accessible using Soma.getInstance().menu.
| add | () | method |
public function add(menuClass:String):MenuAdds a menu to the MenuManager using its class name. The menu class must registered first in Soma: Soma.getInstance().registerClass(MyMenu).
ParametersmenuClass:String — Name of the menu class (for example, the name for a com.project.menu.MyMenu class is MyMenu).
|
Menu —
A Menu class instance (Menu should be the super class of your own menu).
|
| getMainMenu | () | method |
public function getMainMenu():MenuGet the main menu registered (the main menu class is the one registered in the Config class: Soma.getInstance().config.menuClassName).
ReturnsMenu —
A Menu instance (Menu should be the super class of your own menu).
|
| getMenu | () | method |
public function getMenu(menuClass:String):MenuGet a registered menu using its class name.
ParametersmenuClass:String — Class name of the menu.
|
Menu —
A Menu instance (Menu should be the super class of your own menu).
|
| getMenus | () | method |
public function getMenus():DictionaryGet all the menus.
ReturnsDictionary — A Dictionary.
|