Commander

redrocketcms.classes.Commander

 

The Commander class initiates the entire RRC framework. It is automatically initialed with either the Probe or Body classes from the framework. There is no need to manually initialze this class.

 

However, once it has been initialized from a proper Component, it stores vital information you can use at any point throughout the development timeline to retrieve information about the site.

 

This class is entirely static, so all methods can be called like the following example:

 

import redrocketcms.classes.Commander;

var home = Commander.getHomeUrl();

 

m initialize();

Sets the Commander into motion, which in turn initializes other framworks like the History and Soundtrack, then loads and parses the root index.xml file.

m deliver(obj:Object):Void

Delivers an event object to any listeners that are listening for the event.

 

obj:Object

the obj paramter is an event object formatted like an EventDispatcher event. it has at least 2 properties:

 

obj.target:MovieClip - the item dispatching the event

obj.type:String - the name of the event

m subscribe(type:String, obj:Object):Void

Subscribes an object to an event. Uses EventDispatcher.

 

type:String

the event to listen to

 

obj:Object

the object, movieclip, or function to listen to the event

m unsubscribe(type:String, obj:Object):Void

Unsubscribes an object from an event. Uses EventDispatcher.

 

type:String

the event to no longer listen to

 

obj:Object

the object, movieclip, or function to unsubscribe to the event

m getDescription():String

returns String

A string containing the description for the global site.

m getKeywords():String

returns String

A string containing the keywords for the global site.

m getFooterText():String

returns String

A string containing the footer html string. This string has been parsed to only contain one line. But you should make sure and enable html on the textfield you inset this into, or otherwise parse out any html tags.

m getHomeUrl():String

return String

A string representing the home linkage. RRC use a proprietary internal linkage for loading internal content in the format:

 

../{HASH}

 

where {HASH} is the directory in the publish folder where the content lives. If you need to use this information somewhere, you need to make sure and strip the "asfunction:INTERNAL:" portion of the string to get just the hash.

m getSiteKey():String

returns String

Each RR site gets assigned a unique "key" that is 6 characters long. Normally, this is used behind the scenes, but if you should need it, it is there.

m getRootNodes():Array

returns Array

An array of objects representing the "root", or first level or nodes of the navigation. Each member of the array has an object with the following properties:

 

title: the title of the node

href: the url in a proprietary asfuntion format

target: the target frame for the getURL function

style: any style information

reference: the text part of the hash, a url-friendly version of the title

id: the numeric id of the node

pid: the numeric id of the parent node this belongs to (always 0 for root nodes)

m getSubNodes(pid:String):Array

pid:String

the id of the node to which you wish to find all corresponding child nodes. with this function you can create recursive functions to create an eternally-deep navigation structure.

 

returns Array

An array of objects representing the noes which match the pid given. Each member of the array has an object with the following properties:

 

title: the title of the node

href: the url in a proprietary asfuntion format

target: the target frame for the getURL function

style: any style information

reference: the text part of the hash, a url-friendly version of the title

id: the numeric id of the node

pid: the numeric id of the parent node this belongs to (always the pid parameter)

m getNodeByID(id:String):Object

pid:String

the id of the node to which you wish returned.

 

returns Array

An objects representing the noeds which match the id given. The object is returned with the following properties:

 

title: the title of the node

href: the url in a proprietary asfuntion format

target: the target frame for the getURL function

style: any style information

reference: the text part of the hash, a url-friendly version of the title

id: the numeric id of the node

pid: the numeric id of the parent node this belongs to