Difference between revisions of "EventDispatcher:addEventListener"

From GiderosMobile
(----)
Line 1: Line 1:
__NOTOC__
+
'''Available since:''' Gideros 2011.6<br/>
<languages />
+
'''Class:''' [[EventDispatcher]]<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/EventDispatcher|EventDispatcher]]<br/>
+
=== Description ===
=== <translate>Description</translate> ===
+
Registers a listener function and an optional data value so that the listener function is called when an event of a particular type occurs.
<translate><br />
+
 
Registers a listener function and an optional data value so that the listener function is called when an event<br />
 
of a particular type occurs.<br />
 
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
EventDispatcher:addEventListener(type,listener,data)
+
EventDispatcher:addEventListener(type,listener,data)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''type''': (string) <translate>The type of event.</translate> <br/>
+
=== Parameters ===
'''listener''': (function) <translate>The listener function that processes the event.</translate> <br/>
+
'''type''': (string) The type of event. <br/>
'''data''': (any) <translate>An optional data parameter that is passed as a first argument to the listener function.</translate> '''optional'''<br/>
+
'''listener''': (function) The listener function that processes the event. <br/>
 +
'''data''': (any) An optional data parameter that is passed as a first argument to the listener function. '''optional'''<br/>
 +
 
 +
----
 +
{{Special:PrefixIndex/EventDispatcher}}
 +
<br/>

Revision as of 19:12, 2 December 2019

Available since: Gideros 2011.6
Class: EventDispatcher

Description

Registers a listener function and an optional data value so that the listener function is called when an event of a particular type occurs.

EventDispatcher:addEventListener(type,listener,data)

Parameters

type: (string) The type of event.
listener: (function) The listener function that processes the event.
data: (any) An optional data parameter that is passed as a first argument to the listener function. optional