| Package | system.logic |
| Class | public class IfGreaterThan |
| Inheritance | IfGreaterThan IfTask Task Object |
Example :
package examples
{
import system.process.logic.IfGreaterThan;
import flash.display.Sprite;
public class IfGreaterThanExample extends Sprite
{
public function IfGreaterThanExample()
{
var task:IfGreaterThan ;
var value1:uint = 10 ;
var value2:uint = 20 ;
task = new IfGreaterThan( value1 , value2 , new Then(), new Else() ) ;
task.run() ; // else
task = new IfGreaterThan( value2 , value1, new Else() ) ;
task.run() ; // then
task = new IfGreaterThan( value1 , value1 , new Then(), new Else() ) ;
task.run() ; // else
}
}
}
import system.process.Task;
class Then extends Task
{
public function Then() {}
public override function run( ...arguments:Array ):void
{
notifyStarted() ;
trace( "then" ) ;
notifyFinished() ;
}
}
class Else extends Task
{
public function Else() {}
public override function run( ...arguments:Array ):void
{
notifyStarted() ;
trace( "else" ) ;
notifyFinished() ;
}
}
See also
| Method | Defined By | ||
|---|---|---|---|
Creates a new IfGreaterThan instance. | IfGreaterThan | ||
![]() |
Defines the action when the condition block use the else condition. | IfTask | |
![]() |
Defines an action when the condition block use the elseif condition. | IfTask | |
![]() |
Defines the main conditional rule of the task. | IfTask | |
![]() |
Defines the action when the condition block success and must run the 'then' action. | IfTask | |
![]() | clone():* [override]
Returns the shallow copy of the object. | IfTask | |
![]() | isLocked():Boolean
Returns true if the object is locked. | Task | |
![]() | lock():void
Locks the object. | Task | |
![]() | notifyFinished():void
Notify an ActionEvent when the process is finished. | Task | |
![]() | notifyStarted():void
Notify an ActionEvent when the process is started. | Task | |
![]() |
Removes the 'then' action. | IfTask | |
![]() |
Removes the 'else' action. | IfTask | |
![]() |
Removes the 'conditional rule' of the task. | IfTask | |
![]() |
Removes the 'then' action. | IfTask | |
![]() | run(... arguments):void [override]
Run the process. | IfTask | |
![]() | unlock():void
Unlocks the display. | Task | |
| IfGreaterThan | () | Constructor |
public function IfGreaterThan(value1:*, value2:*, thenTask:Action = null, elseTask:Action = null, ... elseIfTasks)Creates a new IfGreaterThan instance.
Parametersvalue1:* — The first value to evaluate.
| |
value2:* — The second value to evaluate.
| |
thenTask:Action (default = null) — The Action reference to defines the 'then' block in the 'if' conditional task.
| |
elseTask:Action (default = null) — The Action reference to defines the 'else' block in the 'if' conditional task.
| |
... elseIfTasks — The Array of ElseIf instance to initialize the 'elseif' blocks in the 'if' conditional task.
|