« back
create():void
This is needed since version 2.15 to start the process of the navigation creation. Because before, in some rare situations, the navigation listeners were not added properly when the navigation was starting. So it should look something like this:
// create Navigation
navigationManager = new NavigationManager2(this, "xml/navig.xml");
navigationManager.setFadeInOnMouseOver(false);
navigationManager.setFade(true);
navigationManager.setFadeInChainDelay(0.3);
// etc.
// Event Listeners
navigationManager.addEventListener(NavigationEvent.MC_ACTIVATED, btnActivateHandler,false,0,true);
navigationManager.addEventListener(NavigationEvent.MC_FADE_IN, btnsFadeIn,false,0,true);
navigationManager.addEventListener(NavigationEvent.MC_FADE_OUT, btnsFadeOut, false, 0, true);
navigationManager.addEventListener(NavigationEvent.LOADING_COMPLETE, loadingCompleteHandler, false, 0, true);
// etc.
// Now all properties are set, all listeners are added: it's save to create the navigation:
navigationManager.create();
setFade(fade:Boolean):void
Default is “false”.
If “false”, the children of a button are visible immediatly at rollOver (if setFadeInOnMouseOver is “true”) or release (when the button is clicked). No onMouseOver event is dispatched.
If “true”, the onMouseOver event is dispatched, where you have to handle the fading in of the children buttons by yourself.
setFadeInOnMouseOver(fade:Boolean):void
Default is “true”.
Note: If you use the xml attribute
btnMakeRoomY, set this to “false”: setFadeInOnMouseOver(false). The combination is not (yet) working as expected!
getFadeInOnMouseOver():Boolean
setFadeInDepth(value:String)
setFadeOutTimerDelay(delay:Number):void
setFadeInChainDelay(delay:Number):void
Default is “0”.
The time the children of a button wait before they fade in when a deeplink is active. This is useful if you have a longer animation for fading in buttons, to have a more sequential over all animation.
See examples, select example Nr. 8 and click on “Deeplink-Demo” at the bottom.
setKeepRolloverStatus(value:Boolean)
getKeepRolloverStatus():Boolean
setAlwaysHideChildren(value:Boolean, hideAtRelease:Boolean = false)
getAlwaysHideChildren():Boolean
setBtnLabelTextNewLine(value:String):void
If you have a navigation menu label that is too long, you can store it in the xml file like this: btnLabel=“This is a too$long menu label”. You can than use a character you like to use as a newline, in this example I have choosen “$”. You now have to tell the navigationManager about this: navigationManager.setBtnLabelTextNewLine(“$”). Now the label will be split at “$”.
setBtnLabelTextNewLine():String
setBtnDepths(rollOutDepth:String, rollOverDepth:String, pressDepth:String, releaseDepth:String, deactivateDepth:String)
Values are “front” or “back”. Default is “front”, “front”, “front”, “front”, “front”
setAutoActivateDelay(n:Number)
getBtnsByID(idArr:Array = null):Array
// Example:
var b:Array = navigationManager.getBtnsByID(["home","about_us","products"]);
trace(b[0].btnSize)
trace(b[1].initX)
trace(b[2].makeRoomY)
getSiblings(id:String, skipBtnID:Boolean = true):Array
Returns an array of NavigationButtons of the same level. If you get the siblings of a btn, than this btn will not be in the array. This is the default. If you want all buttons in the array (including the one you called the method with), use skipBtnID = false.
getParent(id:String):Object
getChildren(id:String):Array
activateBtn(id:String, dispatch:Boolean = true):void
Activates a button. If dispatch is “false”, only the button status will change, but no event will be dispatched. This is required for example when a deeplink is fired and the content is already loading, the button has to reflect the change but should not activate anything. Espacially in
Gaia this is useful, because there the button only reacts to the “goto” event.
getBranchForGaia(id:String):String
Needed for
Gaia projects. There are situations where you need the branches. See the
documentation for more info.
setSuspendAfterInit(value:Boolean):void
Default is “false”. If “true”, the navigation will be suspended (not visible) right after initialisation. This comes in very handy if you need to wait for an intro to finish or some assets to be loaded. When everything is ready, you can release the navigation.
See examples, select example Nr. 16.
releaseSuspendAfterInit():void
This only makes sense if setSuspendAfterInit is “true”, otherwise nothing is suspended and therefor nothing will be released.
See examples, select example Nr. 16.
getSuspended():Boolean
The usage only makes sense if setSuspendAfterInit() is true. You can check if the navigation is still suspended or already released.
Example:
releaseNavigBtn.addEventListener(MouseEvent.CLICK,btnReleaseNavigHandler);
function btnReleaseNavigHandler(event:MouseEvent) {
if (navigationManager.getSuspended()) navigationManager.releaseSuspendAfterInit();
}
resetNavigBtn.addEventListener(MouseEvent.CLICK,btnResetNavigHandler);
function btnResetNavigHandler(event:MouseEvent) {
if (!navigationManager.getSuspended()) navigationManager.resetNavigation();
}
resetNavigation():void
If setSuspendAfterInit is set to “true”, resetNavigation will hide the navigation and deactivate all buttons. If setSuspendAfterInit is “false”, all buttons will be deactivated but the navigation will remain visible.
Also see releaseSuspendAfterInit()
getBtnsContainer():MovieClip
relayoutButtons(btn:NavigationButton2 = null, tweenTime:Number = 0, delay:Number = 0):void