Hi
I am on some way a beginner in this arena but I thought I would share this if anyone else does the same mistake and just copy and paste some code regarding UI buttons.
take a look at the below code
[lua]local menuButton = ui.newButton {
defaultSrc = “BTN_mainmenu.png” , defaultX = “142” , defaultY = “52”,
overSrc = “BTN_mainmenu_clicked.png” , overX = “142”, overY = “52”,
onEvent = menuHandler,
id = “menuButton”
}[/lua]
When you insert that code into your game or app it will trigger twice when clicked upon.
If you instead use onRelease like below
[lua]local menuButton = ui.newButton {
defaultSrc = “BTN_mainmenu.png” , defaultX = “142” , defaultY = “52”,
overSrc = “BTN_mainmenu_clicked.png” , overX = “142”, overY = “52”,
onRelease = menuHandler,
id = “menuButton”
}[/lua]
It will only trigger one time and not twice.
This might be the crappiest post today but since I have been having trouble with it, someone else might as well so I though I would share. [import]uid: 22737 topic_id: 11463 reply_id: 311463[/import]