Click or drag to resize
CoronaRuntimeEnvironmentAddEventListener Method

Subscribes an event handler to be invoked when the given Corona event name gets dispatched.

It is okay to call this method before the runtime has started. Once started, the runtime will automatically subscribe the given handler to the event.

Namespace: CoronaLabs.Corona.WinRT
Assembly: CoronaLabs (in CoronaLabs.dll) Version: 255.255.255.255
Syntax
public void AddEventListener(
	string eventName,
	CoronaLuaEventHandler eventHandler
)

Parameters

eventName
Type: SystemString

The name of the event to subscribe to such as "system", "enterFrame", etc.

You can also specify your own custom event name that you can dispatch in Lua via Runtime:dispatchEvent() or via this object's DispatchEvent(CoronaLuaEventArgs) method.

The given event name cannot be null/empty or else an exception will be thrown.

eventHandler
Type: CoronaLabs.Corona.WinRTCoronaLuaEventHandler

The handler to be invoked when the Corona event has been dispatched/raised.

Cannot be null or else an exception will be thrown.

See Also