Hey all,
I have been using the widget.newButton for a few projects without any issues, but after upgrading to the latest version (I don’t know which version actually broke it), the buttons are not giving up focus.
Steps to reproduce
Two buttons a blank menu.
[lua]playBtn = widget.newButton{
sheet = asset_sheet,
defaultIndex=11, overIndex = 12,
labelColor = { default={ 128, 255, 96, 255 }, over={ 0 } },
width=165, height=165,
left = 292, top = 58,
onRelease = onPlayBtnRelease, – event listener function
onDrag = onPlayBtnRelease
}
storeBtn = widget.newButton{
sheet = asset_sheet,
defaultIndex=13, overIndex = 14,
labelColor = { default={ 128, 255, 96, 255 }, over={ 0 } },
width=97, height=97,
left = 2, top = 198,
onRelease = onStoreBtnRelease – event listener function
}[/lua]
For the sake of this example, lets say that both listener functions just return true.
Also, the example has same results with and without imageSheets.
So, to reproduce the issue, you simply need to initiate a touch on one button and then drag off the button before releasing. Anywhere you click from now on will continue to trigger that button’s default/over images.
I have tried changing the onRelease event to an onEvent event, and manly tried to control the focus using ‘display.getCurrentStage():setFocus( )’
Please let me know if there is anything else you want me to provide. I could whip up a sample project pretty easily, but I figured it wasn’t entirely necessary. Let me know if you want me to provide a simple example in a bug report.
Regards,
Brian Reinhart
[import]uid: 158289 topic_id: 30276 reply_id: 330276[/import]