ListenerInjector

(This tag must be placed inside an <Injectors> tag)

The ListenerInjector tag can be used to add an event listener to a visual component (ie: a view) or to an object created by Mate itself via ObjectBuilder or MethodInvoker.

<Injectors>

   <ListenerInjector eventType="myEvenType" method="myEventTypeHandler" />

</Injectors>

Attributes

eventType

String

required

The event type that, when dispatched, should trigger the method on the listener (the target object in the Injectors tag). It should match the type specified in the event when created. All events extending from flash.events.Event have a "type" property.

While this attribute is a string, a constant is most commonly used:

<ListenerInjector eventType="{MyEvent.MY_EVENT_TYPE}" ... />

Any bubbling up event or an event dispatched by a Mate tag.

method

String

required

The method to run on the listener object. This method should be public and its sole parameter should be of type event (or an event sub-class).