Packagecom.asfusion.mate.actions.builders
Classpublic class EventAnnouncer
InheritanceEventAnnouncer Inheritance ObjectBuilder Inheritance BaseAction Inheritance AbstractAction
ImplementsIAction
SubclassesResponseAnnouncer

EventAnnouncer allows you to dispatch events from a IActionList. When the IActionList is executed, it will create an event of the class specified in the generator attribute.

It will then add any properties to the newly created event and dispatch it. You can pass properties to the event that come from a variety of sources, such as the original event that triggered the IActionList, a server result object, or any other value.

MXML Syntaxexpanded Hide MXML Syntax

The <EventAnnouncer> tag has the following tag attributes:

 <EventAnnouncer
  Properties
 generator="Class"
 constructorArguments="Object|Array"
 type="String"
 bubbles="true|false"
 cancelable="true|false"
  />
 

Example
This example demonstrates how you can create an event using the EventAnnouncer and set its properties using the Properties inner tag.
    <EventAnnouncer
          generator="MyEventClass"
          type="myEventType"/>
 
          <Properties
          myProperty="myValue"
          myProperty2="100"/>
 
 </EventAnnouncer/>
    

See also

com.asfusion.mate.actionLists.EventHandlers


Public Properties
 PropertyDefined by
  bubbles : Boolean
Although you can specify the event's bubbles property, whether you set it to true or false will have little effect, as the event will be dispatched from the Mate Dispatcher itself.
EventAnnouncer
  cancelable : Boolean
Indicates whether the behavior associated with the event can be prevented.
EventAnnouncer
 InheritedconstructorArguments : *
The constructorArgs allows you to pass an Object or an Array of objects to the contructor when the instance is created.
ObjectBuilder
  dispatcherType : String
String that defines whether the dispatcher used by this tag is global or inherit.
EventAnnouncer
  generator : Class
The generator attribute specifies what class should be instantiated.
EventAnnouncer
 Inheritedproperties : Array
Properties allows you to add properties to the currentInstance.
BaseAction
 InheritedregisterTarget : Boolean
Registers the newly created object as an injector target.
ObjectBuilder
  type : String
The type attribute specifies the event type you want to dispatch.
EventAnnouncer
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
  
createInstance(scope:IScope):Object
Where the currentInstance is created using the generator class as the template, passing arguments to the constructor as specified by the constructorArgs (if any).
EventAnnouncer
 Inherited
prepare(scope:IScope):void
The first method that trigger calls.
ObjectBuilder
  
run(scope:IScope):void
Where all the action occurs.
EventAnnouncer
 Inherited
setProperties(scope:IScope):void
Where all the properties are set into the currentInstance.
BaseAction
Property detail
bubblesproperty
bubbles:Boolean  [read-write]

Although you can specify the event's bubbles property, whether you set it to true or false will have little effect, as the event will be dispatched from the Mate Dispatcher itself.

The default value is false.

Implementation
    public function get bubbles():Boolean
    public function set bubbles(value:Boolean):void
cancelableproperty 
cancelable:Boolean  [read-write]

Indicates whether the behavior associated with the event can be prevented.

The default value is true.

Implementation
    public function get cancelable():Boolean
    public function set cancelable(value:Boolean):void
dispatcherTypeproperty 
dispatcherType:String  [read-write]

String that defines whether the dispatcher used by this tag is global or inherit. If it is inherit, the dispatcher used is the dispatcher provided by the EventMap where this tag lives.

Implementation
    public function get dispatcherType():String
    public function set dispatcherType(value:String):void
generatorproperty 
generator:Class  [read-write]

The generator attribute specifies what class should be instantiated. If this attribute is not specified, then a DynamicEvent will be generated.

The default value is mx.events.DynamicEvent.

Implementation
    public function get generator():Class
    public function set generator(value:Class):void
typeproperty 
type:String  [read-write]

The type attribute specifies the event type you want to dispatch.

The default value is null.

Implementation
    public function get type():String
    public function set type(value:String):void
Method detail
createInstance()method
protected override function createInstance(scope:IScope):Object

Where the currentInstance is created using the generator class as the template, passing arguments to the constructor as specified by the constructorArgs (if any).

Parameters
scope:IScope

Returns
Object
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