It looks like you're new here. If you want to get involved, click one of these buttons!
Sorry, you lost me. Was it right or was it wrong?
Comments
OR do you mean, what type of event was dispatched? e:getType()
I thought getTarget() return the listener function according to the reference manual.
It says "The target of an event is a listener function and an optional data value".
https://sites.google.com/site/xraystudiogame
local button = Button.new(up, down)
-- register to "click" event
local click = 0
print(button)
function listener(event)
print(event:getTarget())
click = click + 1
label:setText("Clicked " .. click .. " time(s)")
end
print(listener)
button:addEventListener("click", listener
)
And output:
table: 03399600
function: 0339A4B8
table: 03399600
event:getTarget() return the button, not the listener function.
https://sites.google.com/site/xraystudiogame
https://sites.google.com/site/xraystudiogame