Event:getTarget
From GiderosMobile
Available since: Gideros 2011.6
Class: Event
Description
Returns the element on which the event listener was registered. <syntaxhighlight lang="lua"> (object) = Event:getTarget() </source>
Return values
Returns (object) Target of event.
Example
<syntaxhighlight lang="lua"> function ExplosionLayer:addExplosion(x, y) local explosion ... explosion = MovieClip.new(timeline) explosion:addEventListener(Event.COMPLETE, self.onExplosionComplete, self) ... end
function ExplosionLayer:onExplosionComplete(event) local explosion = event:getTarget() explosion:removeFromParent() self.pool[#self.pool + 1] = explosion end </source>