Event listener for Constraint type events.

The events that can be caught are WAKE, SLEEP and BREAK type events. Theses listeners will only operate on Constraints.

Constructor

@:value({ precedence : 0 })new(event:CbEvent, options:Null<Dynamic>, handler:ConstraintCallback ‑> Void, precedence:Int = 0)

Construct a new ConstraintListener.

The possible event types are WAKE, SLEEP and BREAK.

The options argument is typed Dynamic, and is permitted to be either an OptionType or one of: CbType, CbTypeList, Array<CbType>, flash.Vector<CbType> In which case the input CbType's will be used to construct an OptionType whose included types will be the set of CbTypes supplied.

Parameters:

event

The event type to listen for.

options

The OptionType to match Constraints against, passing null will equate to an empty OptionType.

handler

The callback handler for this listener.

precedence

The precedence of this listener used to sort the order of callbacks in the case of more than one suitable ConstraintListener existing for the same event on the same Constraint. (default 0)

Returns:

The newly constructed ConstraintListener

Throws:

#

If handler is null.

#

If the event type is not permitted for this listener.

#

If options is not of the expected Type.

Variables

options:OptionType

The OptionType used to match against Constraints.

When added to the same Space, any Constraint who's CbType list matches against this OptionType will be issued a callback when the relevant event occurs.

@:value(null)zpp_inner_zn:ZPP_ConstraintListener = null

@private

handler:ConstraintCallback ‑> Void

The callback handler for this event.

Inherited Variables

Defined by Listener

event:CbEvent

The CbEvent this listener responds to.

precedence:Int

The precedence of this listener.

In any case that there is more than one suitable listener for a situation, the listeners will be ordered by their precedence.

space:Null<Space>

The Space this listener is assigned to.

This value can be set, with setting to null being equivalent to removing the listener from whichever Space it is presently assigned to.

read onlytype:ListenerType

The sub-type of this listener.

@:value(null)zpp_inner:ZPP_Listener = null

@private

Inherited Methods

Defined by Listener

@:keeptoString():String

@private