| Package | org.mymvc |
| Class | public class MyMVCCommand |
| Inheritance | MyMVCCommand flash.events.EventDispatcher |
Note, Command should NOT dispatch event through evt.broadcast() or MyMVCRadioStation.dispatch(evt).
| Property | Defined by | ||
|---|---|---|---|
| internalData : *
Internal used by MyMVCC.
| MyMVCCommand | ||
| uniqueID : int
Internal used by MyMVCC.
| MyMVCCommand | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor
| MyMVCCommand | ||
|
execute(input:* = null):void
Execute the command.
| MyMVCCommand | ||
| Method | Defined by | ||
|---|---|---|---|
|
notifyComplete(data:Object = null):void
Notify listeners that the command has completed.
| MyMVCCommand | ||
|
notifyError(data:Object = null):void
Notify listeners that an error has occured executing the command.
| MyMVCCommand | ||
|
notifyProgress(data:Object = null):void
Notify listeners that the command has updated progress.
| MyMVCCommand | ||
| internalData | property |
public var internalData:*Internal used by MyMVCC. Developers don't have to care
| uniqueID | property |
public var uniqueID:intInternal used by MyMVCC. Developers don't have to care
| MyMVCCommand | () | constructor |
public function MyMVCCommand()Constructor
| execute | () | method |
public function execute(input:* = null):voidExecute the command. Abstract method. Subclasses should override this function.
Parametersinput:* (default = null) — The input object. For example, if the class is to log in a user, the input object
may be {user:{username:'jsmith', password:'abcd'}}. Input object should be included in the output
through notifyComplete, notifyProgress, or notifyError.
You should avoid passing VO (value object) directly as argument. |
| notifyComplete | () | method |
protected function notifyComplete(data:Object = null):voidNotify listeners that the command has completed. Every command class should call notifyComplete after process completes.
Parametersdata:Object (default = null) — Data included in the event. In practice you should include the input and the
output all together as data. For example, if the input is {user:{username:'jsmith', password:'abcd'}}
and the class is to log in, then data can be {user:{username:'jsmith', password:'abcd'}, status:'success'}
|
| notifyError | () | method |
protected function notifyError(data:Object = null):voidNotify listeners that an error has occured executing the command.
Parametersdata:Object (default = null) — Data included in the event. Date must have a property called 'message', which is a
String indicating the error message. In practice, you should also include
input content in data.
|
| notifyProgress | () | method |
protected function notifyProgress(data:Object = null):voidNotify listeners that the command has updated progress.
Parametersdata:Object (default = null) — Data included in the event. Date must have a property called 'progress', which is int
ranging from 0 to 100, indicating the percentage completed. In practice, you should also include
input content in data.
Note: The total is 100. Thus progress should be 0-100
|