Difference between revisions of "EventDispatcher:addEventListener"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
<br />
+
<translate><br />
 
Registers a listener function and an optional data value so that the listener function is called when an event<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 />
 
of a particular type occurs.<br />
<br />
+
<br /></translate>
 
<source lang="lua">
 
<source lang="lua">
 
  EventDispatcher:addEventListener(type,listener,data)
 
  EventDispatcher:addEventListener(type,listener,data)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''type''': (string) The type of event. <br/>
+
'''type''': (string) <translate>The type of event.</translate> <br/>
'''listener''': (function) The listener function that processes the event. <br/>
+
'''listener''': (function) <translate>The listener function that processes the event.</translate> <br/>
'''data''': (any) An optional data parameter that is passed as a first argument to the listener function. '''optional'''<br/>
+
'''data''': (any) <translate>An optional data parameter that is passed as a first argument to the listener function.</translate> '''optional'''<br/>

Revision as of 13:32, 23 August 2018

Available since: Gideros 2011.6

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