my example worked fine for me in windows simulator. i was testing it by modifying the “Interface/ButtonEvents” sample in the included Corona demos, but I am using onPress not onEvent
[import]uid: 6645 topic_id: 7353 reply_id: 26037[/import]
The problem of assessing “self” in onEvent, onPress, onRelease with the standard ui.lua is really that when the onTouch event is fired, it then checks for the existence of the other event type and calls the other event type by passing part of the parameters BUT not the self object.
The way I fixed it is to change the ui.lua module so it passes on the self object.
[blockcode]
– note the extra self parameter
local function newButtonHandler( self, event )
…
if onEvent then
– note the extra self parameter
result = onEvent( self, event )
end
[/blockcode]
For my purpose, I also deleted the onPress and onRelease events as I found them redundant.