button widget question

[code]
local widget = require “widget”

local onButtonEvent = function (event )
if event.phase == “release” then
print( “You pressed and released a button!” )
end
end

local myButton = widget.newButton{
id = “btn001”,
left = 100,
top = 200,
label = “Widget Button”,
width = 150, height = 28,
cornerRadius = 8,
onEvent = onButtonEvent
}

– Insert button into a group:
someGroup:insert( myButton ) – if using older build, use: myButton.view instead

– Change the button’s label text:
myButton:setLabel( “My Button” )

– Remove the button
display.remove( myButton )[/code]

The code above is from the button widget docs page. I am wondering how would I make button states using this method? I just want a simple up and over state. I have tried my heart out with no luck. Not sure what to try next. Any help is appreciated. Thanks. [import]uid: 157993 topic_id: 33719 reply_id: 333719[/import]

See the docs for the button widget as well as the ButtonEvents demo in the Interface demos directory, but you’d use:

[lua]default = “buttonYellow.png”,
over = “buttonYellowOver.png”,[/lua]

Happy coding! [import]uid: 64538 topic_id: 33719 reply_id: 134221[/import]

See the docs for the button widget as well as the ButtonEvents demo in the Interface demos directory, but you’d use:

[lua]default = “buttonYellow.png”,
over = “buttonYellowOver.png”,[/lua]

Happy coding! [import]uid: 64538 topic_id: 33719 reply_id: 134221[/import]