Module eventlistener

Event listener variables and functions.

Functions

addListener (listener) Adds the given function to be called once the event fires, and returns the AS3 listener, which can be used with removeListener.
removeListener (as3_listener) Remove the given AS3 listener from being called once the event fires.
removeAllListeners () Remove all AS3 listeners from being called once the event fires.


Functions

addListener (listener)
Adds the given function to be called once the event fires, and returns the AS3 listener, which can be used with removeListener.

Parameters:

  • listener function The listener to be called.

Returns:

    The AS3 instance of the listener. Used for removeListener.

See also:

removeListener (as3_listener)
Remove the given AS3 listener from being called once the event fires. If the listener is removed during the event's invocation, the listener's removal will be delayed until the end of the invocation.

Parameters:

  • as3_listener The AS3 listener to no longer call.

Usage:

     game.start.addListener(function()
    
       run_once = player.tick.addListener(function()
          player.alert("This listener will only run once.")
          player.tick.removeListener(run_once)
       end)
    
    end)
removeAllListeners ()
Remove all AS3 listeners from being called once the event fires. If the listeners are removed during the event's invocation, the listeners' removal will be delayed until the end of the invocation.
generated by LDoc 1.5.0 Last updated 2024-11-25 23:08:11