Packageat.controls
Classpublic class NavigationButton
InheritanceNavigationButton Inheritance mx.controls.Button

The NavigationButton class adds some new functionality to the default Flex Button.

This includes some functionality with Slide navigation. The NavigationButton works well as a "next button" or a "previous button" to navigate sequentially in the slide order, but only if a navigationManager is provided.



Public Properties
 PropertyDefined by
  allowLeaveSection : Boolean = true
Allows leaving a Section when navigating from one node to the next.
NavigationButton
  allowLoopToBegining : Boolean = false
When viewing the last slide in a list, determines the canGoNext value.
NavigationButton
  allowLoopToEnd : Boolean = false
When viewing the first slide in a list, determines the canGoPrev value.
NavigationButton
  canGoNext : Boolean
[read-only] This value is set by the component to be used on this NavigationButton.
NavigationButton
  canGoPrev : Boolean
[read-only] This value is set by the component to be used on this NavigationButton.
NavigationButton
  direction : String = "none"
Determines the direction of the navigation button to move slides forward, backward, or neither (none).
NavigationButton
  navigationManager : SlideManager
NavigationButton
  presentationModule : PresentationModule
NavigationButton
  useDefaultClickHandler : Boolean = true
Specifies whether this control uses the default built-in navigation behavior.
NavigationButton
Public Methods
 MethodDefined by
  
Constructor.
NavigationButton
  
refresh(e:Event = null):void
NavigationButton
Protected Methods
 MethodDefined by
  
Handles a navigation change event, only when navigationManager is set.
NavigationButton
  
onNaviagtionData(e:DataEvent):void
Runs when PresentationModule's or underlying/given SlideManager's DataEvent.Data event is dispatched.
NavigationButton
Property detail
allowLeaveSectionproperty
public var allowLeaveSection:Boolean = true

Allows leaving a Section when navigating from one node to the next.

For example, if the current node is in Section 1 and the next node is in Section 2, allowLeaveSection being set to false will set the canGoNext/canGoPrev to false.

The default value is true.

allowLoopToBeginingproperty 
public var allowLoopToBegining:Boolean = false

When viewing the last slide in a list, determines the canGoNext value. If allowLoopToBegining is true, (and the move is otherwise valid) canGoNext will evaluate to true, false otherwise.

The default value is false.

allowLoopToEndproperty 
public var allowLoopToEnd:Boolean = false

When viewing the first slide in a list, determines the canGoPrev value.

If allowLoopToEnd is true, (and the move is otherwise valid) canGoPrev will evaluate to true, false otherwise.

The default value is false.

canGoNextproperty 
canGoNext:Boolean  [read-only]

This value is set by the component to be used on this NavigationButton. If used as a "next button" for Slide navigation, this can be applied to an enabled property if slides need to stay in the current section. It will be false if at the last slide in a section.

The default value is false.

This property can be used as the source for data binding.

Implementation
    public function get canGoNext():Boolean
canGoPrevproperty 
canGoPrev:Boolean  [read-only]

This value is set by the component to be used on this NavigationButton. If used as a "previous button" for Slide navigation, this can be applied to an enabled property if Slides need to stay in the current section. It will be false if at the first slide in a section.

The default value is false.

This property can be used as the source for data binding.

Implementation
    public function get canGoPrev():Boolean
directionproperty 
public var direction:String = "none"

Determines the direction of the navigation button to move slides forward, backward, or neither (none).

In the case of none, navigation is handled external to the button, and so is enabling/disabling of the button.

Values in ActionScript can be set from the static variables in the NavigationButtonDirection class

.

The default value is "none".

See also

navigationManagerproperty 
navigationManager:SlideManager  [read-write]

Implementation
    public function get navigationManager():SlideManager
    public function set navigationManager(value:SlideManager):void
presentationModuleproperty 
presentationModule:PresentationModule  [read-write]

Implementation
    public function get presentationModule():PresentationModule
    public function set presentationModule(value:PresentationModule):void
useDefaultClickHandlerproperty 
public var useDefaultClickHandler:Boolean = true

Specifies whether this control uses the default built-in navigation behavior.

The default value is true.

Constructor detail
NavigationButton()constructor
public function NavigationButton()

Constructor.

Method detail
navigationChangeHandler()method
protected function navigationChangeHandler(e:NavigationChangeEvent):void

Handles a navigation change event, only when navigationManager is set.

When the navigationManager is set, on every navigation change, the NavigationButton sets the canGoNext and canGoPrev booleans to determine if the button can go to the next slide or previous slide based on the current slide. This value can then be set our bound to the component in MXML to set the visible or enabled property of the button to prevent clicking due to business rules being violated.

Parameters
e:NavigationChangeEvent — The navigation change event
onNaviagtionData()method 
protected function onNaviagtionData(e:DataEvent):void

Runs when PresentationModule's or underlying/given SlideManager's DataEvent.Data event is dispatched. The DataEvent.Data event is dispatched when the SlideManager loadData method is called and data loads successfully. (Note: An NavigationErrorEvent.NAVIGATION_ERROR event is dispatched if data loads unsuccessfully)

Automatially disables this button. If the SlideManager.loadData method is called with the setHomeToDefault_noEvents parameter set to true, note that this button will not enable when the loadData method is called. This is because this button is able to be enabled (if cooresponding moves are valid) once an initial navigation move is made (via the events dispatched as a result of the move).

Parameters
e:DataEvent
refresh()method 
public function refresh(e:Event = null):void

Parameters
e:Event (default = null)