Difference between revisions of "EventDispatcher:removeEventListener"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Removes a listener from the `EventDispatcher` object. `removeEventListener()` function expects<...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
 
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[EventDispatcher]]<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
Removes a listener from the [[EventDispatcher]] object.
Removes a listener from the `EventDispatcher` object. `removeEventListener()` function expects<br />
+
<syntaxhighlight lang="lua">
the same arguments with `addEventListener()` to remove the event. If there is no matching listener<br />
+
EventDispatcher:removeEventListener(type,listener,data)
registered, a call to this function has no effect.<br />
+
</syntaxhighlight>
<br />
+
 
<source lang="lua">
+
'''removeEventListener()''' function expects the same arguments than the '''addEventListener()''' to remove the event.
= EventDispatcher:removeEventListener(typelistenerdata,)
+
 
</source>
+
If there is no matching listener registered, a call to this function has no effect.
'''type:''' (string) The type of event. ''''''<br/>
+
 
'''listener:''' (function) The listener object to remove. ''''''<br/>
+
=== Parameters ===
'''data:''' (any) The data parameter that is used while registering the event. ''''''<br/>
+
'''type''': (string) the type of event<br/>
 +
'''listener''': (function) the listener object to remove<br/>
 +
'''data''': (any) the data parameter that is used while registering the event<br/>
 +
 
 +
{{EventDispatcher}}

Latest revision as of 14:27, 13 July 2023

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