|
Reference - getting started
It's easy to control the menu by ActionScript, technically, you need only those two functions:
addMenu(label:String [, icon:String])
label: the text you want the menu to have
icon: Optional, pass in the link name of the library-item you have exported for ActionScript use
returns: a pointer to the menu that just was added, type: MovieClip of class menu_object
addSubMenu(label:String, href:String, target:String)
label: the text on the submenu-item
href, target: for your convenience and since most of the usage will be as a link-menu to external HTML pages, you can specify an action that links to URL with this arguments
returns: a pointer to the submenu of type MovieClip (class fsNavigation2_submenu)
it's not neccessary to save a reference to each menu you added (var m0:MovieClip = addMenu...), they're stored as an array in the fsNavigation instance. You can access them by typing my_fsNav.menus[i], where my_fsNav is the name of your fsNavigation instance and i the position (zero-based) of the menu you want to change.
Probably, it makes your life easier if you store references yourselves, it's up to you.
Reference - advanced Features
features of the fsNavigation class:
addMenu(label:String [, icon:String])
label: the text you want the menu to have
icon: Optional, pass in the link name of the library-item you have exported for ActionScript use
returns: a pointer to the menu that just was added, type: MovieClip of class menu_object
setDataProvider(xml:XML)
set an XML object as data provider for your navigation. More information follows.
menulabel_y usage example: my_fsNav.menulabel_y = -2
sets the y-position of the menu labels. If you need to change that, do it before you start adding any menus
openMenu
returns the currently open menu, type: MovieClip
menus
returns an array of type MovieClip with all the menus you added
features of the menu_object class:
addSubMenu(label:String, href:String, target:String)
label: the text on the submenu-item
href, target: for your convenience and since most of the usage will be as a link-menu to external HTML pages, you can specify an action that links to URL with this arguments
returns: a pointer to the submenu of type MovieClip (class submenu_object)
setIcon(icon: String)
sets an icon or replaces the current one. Pass in the link name of the MovieClip you want to use as an icon
setColor(color:Color) - usage example: my_fsNav.menus[0].setColor(0xFF0000)
changes the background-color of this menu. The submenus you add after that operation receive the same color. You need to pass in a hexadecimal value 0xRRGGBB .
setTextFormat(textformat:TextFormat)
changes the font to the format you passed in. Is applied to submenus like the setColor property.
openMenu()
opens this menu, if not already open
closeMenu()
closes this menu, if open
text
sets or gets the text of the menu
submenus
returns an array of type MovieClip with all the submenus you added to this menu
finally, the features of the submenu_object class:
setColor(color:Color) - usage example: my_fsNav.menus[0].setColor(0xFF0000)
changes the background-color of this submenu
setTextFormat(textformat:TextFormat)
changes the font to the format you passed in.
text
sets or gets the text of the menu
since both addMenu and addSubMenu return a reference to these MovieClip instances, you can go and set different actions for each, e.g., to control your movie. But please note, you can also destroy the functionality of the menu if you do not know what you're doing.
If you want a submenu to do a certain action, type my_submenu.onRelease = function(){// whatever here};
For changing the action of a menu object, use my_menu.hit.onRelease = function(){//something here};
but then, the submenus won't appear anymore unless you include openMenu() in your function.
Reference - the last part
Please note that fonts are not exported at default, so make sure you use a
font that most internet users have, like Arial, Verdana, Tahoma and so on.
There's another thing with fonts. It looks like it's a Flash bug: For some
reason, Flash can't calculate the height of the text in a textinput (but the
feature textHeight exists). The result is, that you probably want to move the
menu-labels in the vertical direction. You can do this before you add any menu
by setting the menulabel_y property of the fsNavigation instance to a
value around zero. -2 is fine for Arial Narrow, 0 is fine for Tahoma or
Verdana.
If you want to do more, you can, of course. You can change the color and
font of each menu and submenu, but you need to do it manually. Also, please
note that the order you change the appearance matters. If you change the color
of a menu and then add the submenus to it, this submenus will inherit the color
you just set. If you do it after inserting submenus, only the menu is changed
and the kids do not inherit anything.
Maybe you don't like the look of these menu buttons. It's not that I would be
disappointed because I spent many hours on the design, it's your choice. Please
refer to the file fsNavigation_assets.fla. There are some MovieClips
inside. Drage the ones you need to change to your FLA with the fsNavigation and
change them. The fsNavigation will use your MovieClips. You most probably
want to change (or remove) the "3D-effect". To do so, you need the MovieClip
menu_object which contains menu_middle and menu_right
and the left part is directly on the layer shades.
Make sure you export you menu_object into first frame, that makes Flash
using your version. Please do not remove any items from these object, just
make them invisible or whatever. Please also note that I can't support you on these
matter.
|