Hi guys! I need to change my widget.newButton’s image after taping on it to show that it’s active (pressed) now, because we have only 2 states of button now (default, over) I try to do this way
myBtn = widget.newButton{
id = "myBtn",
left = 255,
top = 58,
width = 44,
height = 44,
default = "image1.png",
over = "image2.png",
onEvent = onBtn
}
-- trying to change image after tap to image3.png
local onBtn = function( event )
myBtn.default = "image3.png"
end
trick with .default property does’s work, console shows this error
[text]
Runtime error
?:0: attempt to index field ‘default’ (a string value)
stack traceback:
[C]: ?
?: in function <?:191>
?: in function <?:226>
[/text]
Any ideas? [import]uid: 39634 topic_id: 26587 reply_id: 326587[/import]