Packagecom.jadbox.flashmvc
Classpublic class SuperModel
InheritanceSuperModel Inheritance flash.events.EventDispatcher

This is the class that your model (or model singleton) will extend from.



Public Properties
 PropertyDefined by
  data : Object
data is a variable holder for the user.
SuperModel
  debugMode : Boolean = false
[static] When debugMode is enabled (by default), the application will allow a local connection from SuperLogger for testing.
SuperModel
  isPerfoming : Boolean
[read-only] Returns true or false if the model is currently performing any action
SuperModel
  log : XML
[read-only] Used for getting the global log by SuperModel.superModel.log; Returns a global SuperModel XML log of all actions taken place within the running Flash application
SuperModel
  _runningActions : Dictionary
[static]
SuperModel
  superModel : SuperModel
[static] Used for getting the global log by SuperModel.superModel.log;
SuperModel
Public Methods
 MethodDefined by
  
SuperModel
  
actionAdd(classRef:Class):void
Registers an action class to this model.
SuperModel
  
actionRemove(className:String):void
Removes an action from the model
SuperModel
  
actions():Array
Returns an array of String names for each action on the SuperModel
SuperModel
  
addActionEventListener(action:String, eventName:String, callBack:Function):void
Add an event listner for when an action dispatches an event on the its helper object.
SuperModel
  
addHasActionListeners(action:String, added:Function = null, removed:Function = null):void
This method allows you to specify callback functions for when an action is added or removed on the supermodel.
SuperModel
  
addResultListeners(action:String, success:Function = null, fail:Function = null):void
This method allows you to specify a success and fail callback function for a particular action class on the supermodel.
SuperModel
  
addStatusListeners(action:String, enabled:Function = null, disabled:Function = null):void
This method allows you to specify callback functions for when an action is enabled or disabled for a particular action class on the supermodel.
SuperModel
  
completePerformance(actionHelper:ActionHelper, result:Object, successful:Boolean = true):void
Internal only
SuperModel
  
hasAction(className:String):Boolean
Returns a boolean if an action is registered to the model
SuperModel
  
isEnabled(className:String):Boolean
Retrieves if an action class is either enabled/disabled
SuperModel
  
perform(className:String, onComplete:Function = null, ... params):void
Runs an action class that is registered to the SuperModel.
SuperModel
  
process(meta:Performance, ... params):void
This method is feed a Performance class which details a command to be excuted by this SuperModel.
SuperModel
  
[static] Internal only
SuperModel
  
run(action:*, args:Array):void
Faster way to wrap actions to the SuperModel.
SuperModel
  
setEnabled(className:String, enabled:Boolean = true):void
Sets an action class to be enabled or disabled
SuperModel
Property detail
dataproperty
public var data:Object

data is a variable holder for the user.

debugModeproperty 
public static var debugMode:Boolean = false

When debugMode is enabled (by default), the application will allow a local connection from SuperLogger for testing.

isPerfomingproperty 
isPerfoming:Boolean  [read-only]

Returns true or false if the model is currently performing any action

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

Implementation
    public function get isPerfoming():Boolean
logproperty 
log:XML  [read-only]

Used for getting the global log by SuperModel.superModel.log; Returns a global SuperModel XML log of all actions taken place within the running Flash application

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

Implementation
    public function get log():XML

Example
  
   
   
   
   
    tom,25
   
   
      betty,22
   
   
   
    
   
  
  

_runningActionsproperty 
public static var _runningActions:Dictionary
superModelproperty 
public static var superModel:SuperModel

Used for getting the global log by SuperModel.superModel.log;

Constructor detail
SuperModel()constructor
public function SuperModel()
Method detail
actionAdd()method
public function actionAdd(classRef:Class):void

Registers an action class to this model.

Parameters
classRef:Class — This is your performance class reference
actionRemove()method 
public function actionRemove(className:String):void

Removes an action from the model

Parameters
className:String — This is the performance class name
actions()method 
public function actions():Array

Returns an array of String names for each action on the SuperModel

Returns
Array
addActionEventListener()method 
public function addActionEventListener(action:String, eventName:String, callBack:Function):void

Add an event listner for when an action dispatches an event on the its helper object.

Parameters
action:String — Action name to monitor
 
eventName:String — Event name
 
callBack:Function — Callback function that will carry the Event object. WIP
addHasActionListeners()method 
public function addHasActionListeners(action:String, added:Function = null, removed:Function = null):void

This method allows you to specify callback functions for when an action is added or removed on the supermodel.

Parameters
action:String — This is the action class name that you are monitoring the result of.
 
added:Function (default = null) — Callback function for when the action is added.
 
removed:Function (default = null) — Callback function for when the action is removed.
addResultListeners()method 
public function addResultListeners(action:String, success:Function = null, fail:Function = null):void

This method allows you to specify a success and fail callback function for a particular action class on the supermodel.

Parameters
action:String — This is the action class name that you are monitoring the result of.
 
success:Function (default = null) — Callback function for when the action completes successfully.
 
fail:Function (default = null) — Callback function for when the action fails.
addStatusListeners()method 
public function addStatusListeners(action:String, enabled:Function = null, disabled:Function = null):void

This method allows you to specify callback functions for when an action is enabled or disabled for a particular action class on the supermodel.

Parameters
action:String — This is the action class name that you are monitoring the result of.
 
enabled:Function (default = null) — Callback function for when the action is enabled.
 
disabled:Function (default = null) — Callback function for when the action is disabled.
completePerformance()method 
public function completePerformance(actionHelper:ActionHelper, result:Object, successful:Boolean = true):void

Internal only

Parameters
actionHelper:ActionHelper
 
result:Object
 
successful:Boolean (default = true)
hasAction()method 
public function hasAction(className:String):Boolean

Returns a boolean if an action is registered to the model

Parameters
className:String — This is the performance class name

Returns
Boolean — Returns true or false if this model has the class
isEnabled()method 
public function isEnabled(className:String):Boolean

Retrieves if an action class is either enabled/disabled

Parameters
className:String

Returns
Boolean — Returns true or false if the class is enabled or disabled
perform()method 
public function perform(className:String, onComplete:Function = null, ... params):void

Runs an action class that is registered to the SuperModel.

Parameters
className:String — This is the action class name
 
onComplete:Function (default = null) — CallBack function on class action success. The callback needs one param of type Object for any result data from that action class.
 
... params — The parameters that the performance class expects for its constructor.
process()method 
public function process(meta:Performance, ... params):void

This method is feed a Performance class which details a command to be excuted by this SuperModel.

Parameters
meta:Performance — This is an optional parameter to overrite the Performance parameters.
 
... params
registerPerformance()method 
public static function registerPerformance(action:Object):SuperModel

Internal only

Parameters
action:Object

Returns
SuperModel
run()method 
public function run(action:*, args:Array):void

Faster way to wrap actions to the SuperModel.

Parameters
action:* — Can be a class reference or the string of the class name added to the SuperModel.
 
args:Array — Parameters for the action class.
setEnabled()method 
public function setEnabled(className:String, enabled:Boolean = true):void

Sets an action class to be enabled or disabled

Parameters
className:String — This is the performance class name
 
enabled:Boolean (default = true) — true/false if you want to enable or disable