Package | com.asfusion.mate.actions |
Class | public class StopHandlers |
Inheritance | StopHandlers AbstractAction |
Implements | IAction |
StopHandlers
tag lets you stop a certain IActionList
before it reaches the end of the listeners list. The IActionList
can be stopped based on whether
the "lastReturn" is equal to some value, or based on an external function that tells whether
or not the IActionList
must be stopped.
MXML Syntax Hide MXML Syntax
The <StopHandlers>
tag has the following tag attributes:
<StopHandlers Properties lastReturnEquals="value" stopFunction="Function" eventPropagation="noStop|stopPropagation|stopImmediatePropagation" />
stopFunction
.
private function myStopHandlersFunction(scope:Scope):Boolean { ... here you do some evaluation to determine whether to stop the Actionlist or not... return false; //or return true; } <StopHandlers stopFunction="myStopHandlersFunction"/>
See also
Property | Defined by | ||
---|---|---|---|
eventPropagation : String
This attribute lets you stop the event that triggered the
IActionList . | StopHandlers | ||
lastReturnEquals : *
If there exists a
MethodInvoker right before the StopHandlers, and the execution of the
function of the MethodInvoker returned a value ("lastReturn"), you can compare it to some other
value and stop the IActionList if it is equal. | StopHandlers | ||
stopFunction : Function
A function to call to determine whether or not the
IActionList must stop
execution. | StopHandlers |
Method | Defined by | ||
---|---|---|---|
The last method that
trigger calls. | AbstractAction | ||
The first method that
trigger calls. | AbstractAction | ||
Where all the action occurs.
| StopHandlers | ||
setProperties(scope:IScope):void
Where all the properties are set into the
currentInstance . | AbstractAction |
eventPropagation | property |
eventPropagation:String
[read-write]
This attribute lets you stop the event that triggered the IActionList
. If there are any handlers for
this event other than this IActionList
, they will not be notified if the propagation of the event
is stopped. See Flex documentation regarding the difference between stop propagation and stop immediate propagation
The default value is stopImmediatePropagation
.
public function get eventPropagation():String
public function set eventPropagation(value:String):void
lastReturnEquals | property |
lastReturnEquals:*
[read-write]
If there exists a MethodInvoker
right before the StopHandlers, and the execution of the
function of the MethodInvoker
returned a value ("lastReturn"), you can compare it to some other
value and stop the IActionList
if it is equal.
public function get lastReturnEquals():*
public function set lastReturnEquals(value:*):void
stopFunction | property |
stopFunction:Function
[read-write]
A function to call to determine whether or not the IActionList
must stop
execution. This is a more flexible approach than using lastReturnEquals.
The function that you implement needs to return true if the IActionList
must stop or false if not.
public function get stopFunction():Function
public function set stopFunction(value:Function):void
run | () | method |
protected override function run(scope:IScope):void
Where all the action occurs. At this moment, the currentInstance
is already instantiated and all the properties are already set.
scope:IScope |