Difference between revisions of "EventDispatcher:removeEventListener"

From GiderosMobile
m (formatting)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Removes a listener from the [[EventDispatcher]] object.
 
Removes a listener from the [[EventDispatcher]] object.
<br/>
 
 
''removeEventListener()'' function expects the same arguments than the ''addEventListener()'' to remove the event. If there is no matching listener registered, a call to this function has no effect.
 
 
 
<source lang="lua">
 
<source lang="lua">
 
EventDispatcher:removeEventListener(type,listener,data)
 
EventDispatcher:removeEventListener(type,listener,data)
 
</source>
 
</source>
 +
 +
'''removeEventListener()''' function expects the same arguments than the '''addEventListener()''' to remove the event.
 +
 +
If there is no matching listener registered, a call to this function has no effect.
  
 
=== Parameters ===
 
=== Parameters ===
'''type''': (string) The type of event. <br/>
+
'''type''': (string) the type of event<br/>
'''listener''': (function) The listener object to remove. <br/>
+
'''listener''': (function) the listener object to remove<br/>
'''data''': (any) The data parameter that is used while registering the event. <br/>
+
'''data''': (any) the data parameter that is used while registering the event<br/>
  
 
{{EventDispatcher}}
 
{{EventDispatcher}}

Revision as of 19:29, 8 September 2021

Available since: Gideros 2011.6
Class: EventDispatcher

Description

Removes a listener from the EventDispatcher object.

EventDispatcher:removeEventListener(type,listener,data)

removeEventListener() function expects the same arguments than the addEventListener() to remove the event.

If there is no matching listener registered, a call to this function has no effect.

Parameters

type: (string) the type of event
listener: (function) the listener object to remove
data: (any) the data parameter that is used while registering the event