How To Disable UI Button -- Please Help

Hi,

I need some help about a ui button.

Ok, so I have created the button and it is working exactly the way I want after performing onPress but the issue is that I want to disable or deactivate the button after onPress so that once the button is clicked, it does not function any more.

I need help regarding this.

Thank you.
[import]uid: 121356 topic_id: 21350 reply_id: 321350[/import]

Hi, post up some code (stripped down example would be great) of how your doing this and i can point you in the right direction :slight_smile: [import]uid: 84637 topic_id: 21350 reply_id: 84557[/import]

Ok so it’s pretty simple.

When you press the UI button it says to call a function. :slight_smile:

So all you need to do is call your function like this:

[code]

pressedButton = true
function pressButton()
if pressedButton == true then
object:removeSelf()? – Change this to fit your needs.

– YOU WOULD THEN ADD THIS LINE OF CODE:
pressedButton = false
– THE BUTTON WILL BE “DISABLED” NOW.

if pressedButton == false then
– When you say:“pressedButton=false”; the button will do nothing.
end
end
end [import]uid: 23689 topic_id: 21350 reply_id: 84583[/import]

You asked this twice in different forums, please take a look at our rules before posting again; http://developer.anscamobile.com/forum/2011/05/05/forum-rules-and-guidelines

Thanks :slight_smile:

Peach [import]uid: 52491 topic_id: 21350 reply_id: 84603[/import]