Packagecom.jadbox.flashmvc2
Classpublic class SuperAction

This class acts as a proxy to dispatch SuperEvents to your action commands. You do not extend this class for typical framework use.



Public Properties
 PropertyDefined by
  actionRef : Class
SuperAction
  enabled : Boolean
Tells if an action is enabled.
SuperAction
  isBusy : Boolean
[read-only] Tells if an action of this type is currently running.
SuperAction
  lastSuperEvent : SuperEvent
[read-only] Returns the last SuperEvent fired after completing an action.
SuperAction
  superModel : SuperModel
SuperAction
Public Methods
 MethodDefined by
  
SuperAction(actionRef:Class, eventRef:Class = null)
The constuctor
SuperAction
  
addCompleteListener(onSuccess:Function = null, onFail:Function = null):void
This is a shorthand for addEventListener.
SuperAction
  
addEventListener(type:String, listener:Function):void
Listener for when an action completes and other statuses (see SuperEvent).
SuperAction
  
bindVars(... REST):void
This method looks at the SuperEvent fired from the completed action, and copies properties to the SuperModel from the SuperEvent.
SuperAction
  
runEvent(e:SuperEvent = null):void
This method will run the SuperAction with the SuperEvent as its model.
SuperAction
Property detail
actionRefproperty
public var actionRef:Class
enabledproperty 
enabled:Boolean  [read-write]

Tells if an action is enabled. If an action is disabled, it will not be dispatched.

Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
isBusyproperty 
isBusy:Boolean  [read-only]

Tells if an action of this type is currently running.

Implementation
    public function get isBusy():Boolean
lastSuperEventproperty 
lastSuperEvent:SuperEvent  [read-only]

Returns the last SuperEvent fired after completing an action. Use this with caution as it is not as reliable as just listening for the SuperEvent.COMPLETE. Remember that you will need to cast this property to a specific SuperEvent type.

Implementation
    public function get lastSuperEvent():SuperEvent
superModelproperty 
public var superModel:SuperModel
Constructor detail
SuperAction()constructor
public function SuperAction(actionRef:Class, eventRef:Class = null)

The constuctor

Parameters
actionRef:Class — Class reference to the class that does an action.
 
eventRef:Class (default = null) — The event class reference that the action class uses for its first parameter.
Method detail
addCompleteListener()method
public function addCompleteListener(onSuccess:Function = null, onFail:Function = null):void

This is a shorthand for addEventListener. It raps the Event.Complete for when the SuperEvent is successful or not.

Parameters
onSuccess:Function (default = null) — OnSucces function listener
 
onFail:Function (default = null) — OnFail function listener
addEventListener()method 
public function addEventListener(type:String, listener:Function):void

Listener for when an action completes and other statuses (see SuperEvent).

Parameters
type:String — The event name (like SuperEvent.COMPLETE)
 
listener:Function — The listener function (the function will need a handler for SuperEvent)
bindVars()method 
public function bindVars(... REST):void

This method looks at the SuperEvent fired from the completed action, and copies properties to the SuperModel from the SuperEvent. Example: bindVars("email") would sync the SuperEvent's "email" property to its SuperModel property "email". This method is ideal for linking several SuperEvents that have a similair property to be copied to SuperModel for global reference.

Parameters
... REST — The properties on the SuperEvent to copy over to SuperModel once the action completes.
runEvent()method 
public function runEvent(e:SuperEvent = null):void

This method will run the SuperAction with the SuperEvent as its model.

Parameters
e:SuperEvent (default = null) — The SuperEvent that the view wants to run an action on.