Packagecom.asfusion.mate.actions
Classpublic class StopHandlers
InheritanceStopHandlers Inheritance AbstractAction
ImplementsIAction

The 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 Syntaxexpanded Hide MXML Syntax

The <StopHandlers> tag has the following tag attributes:

  <StopHandlers
   Properties
  lastReturnEquals="value"
  stopFunction="Function"
  eventPropagation="noStop|stopPropagation|stopImmediatePropagation"
   />
  

Example
This example demonstrates how you can use a StopHandlers tag with a custom custom 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

com.asfusion.mate.actionLists.EventHandlers


Public Properties
 PropertyDefined 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
Protected Properties
 PropertyDefined by
 InheritedcurrentInstance : * = null
The currentInstance is the Object that this class will use and modify to do its work.
AbstractAction
 Inheriteddocument : Object
A reference to the document object associated with the IActionList that contains this action item.
AbstractAction
Public Methods
 MethodDefined by
 Inherited
initialized(document:Object, id:String):void
Called automatically by the MXML compiler if the AbstractAction is set up by using a tag.
AbstractAction
 Inherited
trigger(scope:IScope):void
This method gets called when the IActionList (ex: EventHandlers) is running.
AbstractAction
Protected Methods
 MethodDefined by
 Inherited
complete(scope:IScope):void
The last method that trigger calls.
AbstractAction
 Inherited
prepare(scope:IScope):void
The first method that trigger calls.
AbstractAction
  
run(scope:IScope):void
Where all the action occurs.
StopHandlers
 Inherited
setProperties(scope:IScope):void
Where all the properties are set into the currentInstance.
AbstractAction
Property detail
eventPropagationproperty
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.

Implementation
    public function get eventPropagation():String
    public function set eventPropagation(value:String):void
lastReturnEqualsproperty 
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.

Implementation
    public function get lastReturnEquals():*
    public function set lastReturnEquals(value:*):void
stopFunctionproperty 
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.

Implementation
    public function get stopFunction():Function
    public function set stopFunction(value:Function):void
Method detail
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.

Parameters
scope:IScope