Hey guys, I try to use that function with the latest daily build but it didn’t worked out. The color changes when I release the button, but not while I’m still pressing it.
Thanks that the widgets library is open source, I was able to find a work around, it’s not pretty but it is working. This is my work around:
[lua]
– Function to handle button events
local function handleButtonEvent( event )
local phase = event.phase
local target = event.target._view._over
if “began” == phase then
target:setFillColor( 255, 0, 0 )
elseif “ended” == phase then
target:setFillColor( 0, 255, 255 )
print( “You pressed and released a button!” )
end
end
[/lua]
The minor change was to reference the target as “event.target._view._over” instead of “event.target” directly.
I hope this might help somebody until the original solution works again.