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.

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 :)

Ok so it's pretty simple.

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

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

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 :)

Peach

views:1796 update:2012/2/7 8:40:54
corona forums © 2003-2011