event.target

Type DisplayObject
Event sprite
Revision Release 2024.3703
Keywords sprite

Overview

The sprite that generated the event; its current properties may also be accessed via this property. For example, event.target.sequence would provide the current sequence for the sprite.

Example

local function spriteListener( event )
    print( "Sprite event: ", event.target.sequence, event.phase )
end

-- Add sprite listener (assumes "mySprite" is a valid sprite object)
mySprite:addEventListener( "sprite", spriteListener )