Packageat.managers
Classpublic class SlideManager
InheritanceSlideManager Inheritance flash.events.EventDispatcher
ImplementsINavigationManager
SubclassesMultiPathSlideManager

Accepts an XMLList where each childnode represents a content slide. This list can then be walked forward and backward through simple methods. Additional methods are provided for non-linear movement, so a slide can be navigated to (jumped to) in various ways. When this navigation takes place, the currentNode property is changed, and events are dispatched before and after that navigation allowing interested listners to react to the change. Note that this class only hanldes the current positioning of an index in it's dataprovider, and informs interested subscribers. It does not actually perform resulting actions based on navigation. That is the job of the classes listening to this one. (Example: PresentationModule).



Public Properties
 PropertyDefined by
  allSlides : XMLList
[read-only]
SlideManager
  currentBaseNodeIndex : int
[read-only] If this class is subclassed, this method provides an alternate way to get to the index of the current node in the native dataProvider instead of having to use the sub-classed override implementation of the currentIndex method.
SlideManager
  currentID : String
[read-only] Returns the id attribute value (String) of the current ndoe
SlideManager
  currentIndex : int
SlideManager
  currentNode : XML
[read-only] Current node in the slide list
SlideManager
  debugMode : Boolean = false
If true, trace statements reveal internal variable values at runtime.
SlideManager
  loadedData : XMLList
[read-only] The data that is loaded into the manager via the loadData method.
SlideManager
  lockable : Boolean = false
If true, locks navigation for the duration specified in the lockTimeLimitMSec property.
SlideManager
  lockNav : Boolean
Indicates that navigation has been locked and navigation requests will be ignored.
SlideManager
  lockTimeLimitMSec : uint = 1000
Duration to lock navigation (ignore requests) for when lockable is set to true.
SlideManager
  slideCount : uint
[read-only] Returns a number of slides in the SlideManager's dataProvider
SlideManager
Public Methods
 MethodDefined by
  
SlideManager(debugMode:Boolean = false)
Creates a new SlideManager.
SlideManager
  
getBaseNodeIndex(referenceNode:XML):int
If this class is subclassed, this method provides an alternate way to get to the native dataProvider instead of having to use the sub-classed getNodeIndex method.
SlideManager
  
getCurrentNode(byReference:Boolean = false):XML
Returns a copy of the current node or a reference if specified.
SlideManager
  
getDefaultNode(byReference:Boolean = false):XML
Returns a copy of the default slide node
SlideManager
  
getLastVisitedNode(byReference:Boolean = false):XML
Returns the last visited node, which may be different than the once preceding the current node in the dataProvider (i.e.
SlideManager
  
getNextBaseNode(stayInTeir:Boolean = false, byReference:Boolean = false):XML
If this class is subclassed, this method provides an alternate way to get to the native dataProvider instead of having to use the sub-classed getNextNode method.
SlideManager
  
getNextNode(stayInTeir:Boolean = false, byReference:Boolean = false):XML
Returns the node following the current node
SlideManager
  
getNodeById(dbid:String, byReference:Boolean = false):XML
Searches the naviagation structure for the first node having the dbid specified
SlideManager
  
getNodeByIndex(index:int, byReference:Boolean = false):XML
Returns the node at the specified index in the slide list.
SlideManager
  
getNodeIndex(referenceNode:XML):int
Returns the index of the referenced node in the slide list of the dataProvider
SlideManager
  
getPreviousNode(stayInTeir:Boolean = false, byReference:Boolean = false):XML
Returns the node preceding the current node
SlideManager
  
gotoNext(stayInTeir:Boolean = false, ignoreValidation:Boolean = false):Boolean
Method navigates to the XML node following the current node in the slide list of the dataProvider.
SlideManager
  
gotoPrev(stayInTeir:Boolean = false, ignoreValidation:Boolean = false):Boolean
Method navigates to the XML node preceding the current node in the slide list of the dataProvider.
SlideManager
  
loadData(data:XMLList, setHomeToDefault_noEvents:Boolean = false, navigateHomeAndDispatchEvents:Boolean = false):Boolean
Uses the specified XMLList as a datasource for navigation requests.
SlideManager
  
navigateHome(ignoreValidation:Boolean = false):Boolean
Naviagates to the default node (slide having selected="true" as an attribute)
SlideManager
  
navigateTo(slide_dbid_or_section_Title:String, ignoreValidation:Boolean = false):Boolean
Navigates to the slide with a matching dbid attribute value specified or a parent node with a matching title attribute
SlideManager
  
navigateToNode(destinationNode:XML, ignoreValidation:Boolean = false):ValidationResult
Navigates to the specified node in slide list dataProvider
SlideManager
  
navigateToSlideIndex(index:int, ignoreValidation:Boolean = false):Boolean
Navigates to the slide at the specified index within the slide list in the dataProvider
SlideManager
  
reset(loadDefaultSlide:Boolean = true):void
Resets the navigation manager.
SlideManager
  
unlock(slideManager:SlideManager, unlock:Boolean):void
[static] Locks or unlocks the specified SlideManager.
SlideManager
Protected Methods
 MethodDefined by
  
validateChange(destinationNode:XML):ValidationResult
Checks if the requested change is valid based upon business rules set in the current node and the destination node by caling the static method NavigationChangeValidator.ValidateChange with the SlideManager's current node and the specified desitnation node.
SlideManager
Events
 EventSummaryDefined by
   Dispatched after the target SlideManager has moved to it's new destination and properties have been updated.SlideManager
   Dispatched after the request has been determined to be valid, but before the target SlideManager has changed any of it's properties.SlideManager
   Dispatched when a navigation requset cannot be fulfilled.SlideManager
   Dispatched when the loadData method after the dataProvider has been updated (unless specified not to dispatch when loadData is called) SlideManager
   Dispatched when a navigation request is made, be it a valid request or not.SlideManager
Property detail
allSlidesproperty
allSlides:XMLList  [read-only]

Implementation
    public function get allSlides():XMLList
currentBaseNodeIndexproperty 
currentBaseNodeIndex:int  [read-only]

If this class is subclassed, this method provides an alternate way to get to the index of the current node in the native dataProvider instead of having to use the sub-classed override implementation of the currentIndex method.

Implementation
    public function get currentBaseNodeIndex():int
currentIDproperty 
currentID:String  [read-only]

Returns the id attribute value (String) of the current ndoe

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

Implementation
    public function get currentID():String
currentIndexproperty 
currentIndex:int  [read-write]

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

Implementation
    public function get currentIndex():int
    public function set currentIndex(value:int):void
currentNodeproperty 
currentNode:XML  [read-only]

Current node in the slide list

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

Implementation
    public function get currentNode():XML
debugModeproperty 
public var debugMode:Boolean = false

If true, trace statements reveal internal variable values at runtime.

loadedDataproperty 
loadedData:XMLList  [read-only]

The data that is loaded into the manager via the loadData method.

Implementation
    public function get loadedData():XMLList
lockableproperty 
public var lockable:Boolean = false

If true, locks navigation for the duration specified in the lockTimeLimitMSec property.

lockNavproperty 
lockNav:Boolean  [read-write]

Indicates that navigation has been locked and navigation requests will be ignored.

Note: Locking of the navigation is done externally to the SlideManager

Implementation
    public function get lockNav():Boolean
    public function set lockNav(value:Boolean):void
lockTimeLimitMSecproperty 
public var lockTimeLimitMSec:uint = 1000

Duration to lock navigation (ignore requests) for when lockable is set to true.

slideCountproperty 
slideCount:uint  [read-only]

Returns a number of slides in the SlideManager's dataProvider

Implementation
    public function get slideCount():uint
Constructor detail
SlideManager()constructor
public function SlideManager(debugMode:Boolean = false)

Creates a new SlideManager.

Parameters
debugMode:Boolean (default = false) — If true, trace statements reveal internal variable values at runtime.
Method detail
getBaseNodeIndex()method
public function getBaseNodeIndex(referenceNode:XML):int

If this class is subclassed, this method provides an alternate way to get to the native dataProvider instead of having to use the sub-classed getNodeIndex method.

Parameters
referenceNode:XMLXMLNode to get the index of

Returns
int — index of the node in the native dataProvider
getCurrentNode()method 
public function getCurrentNode(byReference:Boolean = false):XML

Returns a copy of the current node or a reference if specified.

Parameters
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XML — Copy of or reference to the current slide XML node.
getDefaultNode()method 
public function getDefaultNode(byReference:Boolean = false):XML

Returns a copy of the default slide node

Parameters
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XML — Copy of or reference to the default slide XML node.
getLastVisitedNode()method 
public function getLastVisitedNode(byReference:Boolean = false):XML

Returns the last visited node, which may be different than the once preceding the current node in the dataProvider (i.e. if jumping to nodes out of sequence)

Parameters
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XMLXML of the last visited slide node.
getNextBaseNode()method 
public function getNextBaseNode(stayInTeir:Boolean = false, byReference:Boolean = false):XML

If this class is subclassed, this method provides an alternate way to get to the native dataProvider instead of having to use the sub-classed getNextNode method. If not sub-classed, has the same behavior as getNextNode

Parameters
stayInTeir:Boolean (default = false) — if nodes are children of categories, specifies to return null in the node is the last in one of those categories, instead of returning the first node of the next category.
 
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XMLXMLNode of the next slide in the dataProvider.
getNextNode()method 
public function getNextNode(stayInTeir:Boolean = false, byReference:Boolean = false):XML

Returns the node following the current node

Parameters
stayInTeir:Boolean (default = false) — if nodes are children of categories, specifies to return null in the node is the last in one of those categories, instead of returning the first node of the next category.
 
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XMLXMLNode of the next slide node.
getNodeById()method 
public function getNodeById(dbid:String, byReference:Boolean = false):XML

Searches the naviagation structure for the first node having the dbid specified

Parameters
dbid:String — dbid attribute value of the node to return.

Note: If the same slide is in the list of slide nodes twice, for instance if wanting to summerize with a slide used earlier in the list, this method returns the first instance of the node in the list. When searching by reference, and if using the NavigateToNodeM/code> method remember that navigation would go to the first instance only. If wanting to navigate to the second instance of the same node, you must use the navigateToIndex method.

 
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XML — Copy of or reference to the slide slide XML with the matching dbid attribute value.
getNodeByIndex()method 
public function getNodeByIndex(index:int, byReference:Boolean = false):XML

Returns the node at the specified index in the slide list.

Parameters
index:int — index of the node to return
 
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XML — Copy of or reference to the slide slide XML with the matching dbid attribute value.
getNodeIndex()method 
public function getNodeIndex(referenceNode:XML):int

Returns the index of the referenced node in the slide list of the dataProvider

Parameters
referenceNode:XMLXMLNode to get the index of

Returns
int — index of the node
getPreviousNode()method 
public function getPreviousNode(stayInTeir:Boolean = false, byReference:Boolean = false):XML

Returns the node preceding the current node

Parameters
stayInTeir:Boolean (default = false) — if nodes are children of categories, specifies to return null in the node is the last in one of those categories, instead of returning the first node of the next category.
 
byReference:Boolean (default = false) — If true, returns a reference of the return node, if false returns a copy of it.

Returns
XMLXML of the previous slide node.
gotoNext()method 
public function gotoNext(stayInTeir:Boolean = false, ignoreValidation:Boolean = false):Boolean

Method navigates to the XML node following the current node in the slide list of the dataProvider. If the current node is null, it starts at the default slide node specified by the first node with a selected attribute set to "true".

Parameters
stayInTeir:Boolean (default = false) — if nodes are children of categories, specifies to return null in the node is the last in one of those categories, instead of returning the first node of the next category.
 
ignoreValidation:Boolean (default = false) — forces navigation even if it violates business contraints of the currentNode or the destination node.

Returns
Boolean — true if the navigation was successful, otherwise false.
gotoPrev()method 
public function gotoPrev(stayInTeir:Boolean = false, ignoreValidation:Boolean = false):Boolean

Method navigates to the XML node preceding the current node in the slide list of the dataProvider. If the current node is null, it starts at the default slide node specified by the first node with a selected attribute set to "true".

Parameters
stayInTeir:Boolean (default = false) — if nodes are children of categories, specifies to return null in the node is the last in one of those categories, instead of returning the first node of the next category.
 
ignoreValidation:Boolean (default = false) — forces navigation even if it violates business contraints of the currentNode or the destination node.

Returns
Boolean — true if the navigation was successful, otherwise false.
loadData()method 
public function loadData(data:XMLList, setHomeToDefault_noEvents:Boolean = false, navigateHomeAndDispatchEvents:Boolean = false):Boolean

Uses the specified XMLList as a datasource for navigation requests. If successful, dispatches a flash.events.DataEvent.DATA event. If unsuccessful, dispatches a at.events.NavigationErrorEvent.NAVIGATION_ERROR event.

Parameters
data:XMLList — XMLList to use as a data source.
 
setHomeToDefault_noEvents:Boolean (default = false) — sets the currentNode to the first slide XMLNode with the attribute-value pair of selected="true" in the given data parameter, but does not dispatch any events.
 
navigateHomeAndDispatchEvents:Boolean (default = false) — sets the currentNode to the first slide XMLNode with the attribute-value pair of selected="true" in the given data parameter, and dispatches all associated events

Returns
Boolean — true if the navigation was successful, otherwise false.
navigateHome()method 
public function navigateHome(ignoreValidation:Boolean = false):Boolean

Naviagates to the default node (slide having selected="true" as an attribute)

Parameters
ignoreValidation:Boolean (default = false) — forces the navigate to home request, even if it violates business contraints of the currentNode or the defaultNode.

Returns
Boolean — true if the navigation was successful, otherwise false.
navigateTo()method 
public function navigateTo(slide_dbid_or_section_Title:String, ignoreValidation:Boolean = false):Boolean

Navigates to the slide with a matching dbid attribute value specified or a parent node with a matching title attribute

Parameters
slide_dbid_or_section_Title:String — specifies the section title of the section to navigate to, or the dbid attribute value of the slide to navigate to
 
ignoreValidation:Boolean (default = false) — forces navigation even if it violates business contraints of the currentNode or the destination node.

Returns
Boolean — true if the navigation was successful, otherwise false.
navigateToNode()method 
public function navigateToNode(destinationNode:XML, ignoreValidation:Boolean = false):ValidationResult

Navigates to the specified node in slide list dataProvider

Parameters
destinationNode:XML — reference to the node to navigate to
 
ignoreValidation:Boolean (default = false) — forces navigation even if it violates business contraints of the currentNode or the destination node.

Returns
ValidationResult — true if the navigation was successful, otherwise false.
navigateToSlideIndex()method 
public function navigateToSlideIndex(index:int, ignoreValidation:Boolean = false):Boolean

Navigates to the slide at the specified index within the slide list in the dataProvider

Parameters
index:int — index of the slide to navigate to
 
ignoreValidation:Boolean (default = false) — forces the navigate to the requested index, even if it violates business contraints of the currentNode or the destination node.

Returns
Boolean — true if the navigation was successful, otherwise false.
reset()method 
public function reset(loadDefaultSlide:Boolean = true):void

Resets the navigation manager. Dispatches events indicating either a navigation to the default slide has occured, or that the current slide has been set to null.

Parameters
loadDefaultSlide:Boolean (default = true) — If true, navigates to the default node, if false, navigates to a null position and dispatches three events in the following order:

    NavigationChangeEvent.NAVIGATION_REQUEST
    NavigationChangeEvent.NAVIGATION_CHANGING
    NavigationChangeEvent.NAVIGATION_CHANGED

Note that in all three event types dispatched the newNode property of the NavigationChangeEvent will be null, however, because the change does not occur in the target until after the second NavigationChangeEvent.NAVIGATION_CHANGING event has fired, the target's currentNode property will remain non-null until after NavigationChangeEvent.NAVIGATION_CHANGING has been dispatched, but before the NavigationChangeEvent.NAVIGATION_CHANGED has been dispatched.

unlock()method 
public static function unlock(slideManager:SlideManager, unlock:Boolean):void

Locks or unlocks the specified SlideManager.

Parameters
slideManager:SlideManager
 
unlock:Boolean
validateChange()method 
protected function validateChange(destinationNode:XML):ValidationResult

Checks if the requested change is valid based upon business rules set in the current node and the destination node by caling the static method NavigationChangeValidator.ValidateChange with the SlideManager's current node and the specified desitnation node.

Parameters
destinationNode:XML — The requested node to navigate to.

Returns
ValidationResultValidationResult indicating whether there would be an error in the requested navigation. If there is no error, the isError property of the ValidationResult will be set to false, if an error exists and therefore is invalid, the isError property will be set to true.

See also

Event detail
navigationChangedevent 
Event object type: at.events.NavigationChangeEvent

Dispatched after the target SlideManager has moved to it's new destination and properties have been updated.

navigationChangingevent  
Event object type: at.events.NavigationChangeEvent

Dispatched after the request has been determined to be valid, but before the target SlideManager has changed any of it's properties. Dispatched after the navigationRequest event.

navigationErrorevent  
Event object type: at.events.NavigationErrorEvent

Dispatched when a navigation requset cannot be fulfilled. Either because of a programmtic failure or in the event that a navigation business constaint has was violated in a navigation attempt.

navigationLoadedevent  
Event object type: flash.events.DataEvent

Dispatched when the loadData method after the dataProvider has been updated (unless specified not to dispatch when loadData is called)

navigationRequestevent  
Event object type: at.events.NavigationChangeEvent

Dispatched when a navigation request is made, be it a valid request or not.