Can anyone please help me figure out how to disable a UI button. I am using the latest Ui however, I tried button1.isActive=false and the solution on the forum nothing works for me so far. He’s what I am trying to do, I want to Disabled button1, when Load button is touch and change the OverSCR image on button1 with another image. Here my code below please help me figure out what I am doing wrong here? Thank you for the help.
button1 = ui.newButton{
defaultSrc = “img.png”,
overSrc = “img”,
defaultX = 35,
defaultY = 40,
overX = 35,
overY = 40,
–onEvent = button1inactive,
–onPress = button1Click,
–onRelease=button1inactive,
id =”button1?,
text =”",
font =”Arial”,
textColor = { 51, 51, 51, 255 },
align = “left”,
size = 22,
}
LoadButton = ui.newButton{
defaultSrc = “img2.png”,
overSrc = “img2.png”,
defaultX = 35,
defaultY = 40,
overX = 35,
overY = 40,
–onEvent = button1inactive,
–onPress = button1Press,
–onRelease = button1Release,
id =”button1?,
text =”",
font =”Arial”,
textColor = { 51, 51, 51, 255 },
align = “left”,
size = 22,
}
function LoadButton:touch( event )
if event.phase == “release” and button1.isActive and X==Y then
button1.isActive = false
– I also want the change the overSrC image for button1 here. How to do that?
esle
button1.isActive=true
end
end
LoadButton:addEventListener (“touch”, LoadButton)
Thank you in advance [import]uid: 104131 topic_id: 19555 reply_id: 319555[/import]