How do I disable mouse or touch on a sprite button

Get help using Construct 2

Post » Thu Jul 17, 2014 12:08 am

I have a sprite that I am using as a button. I want to make sure the button can only be clicked once, until a certain condition is met (it's an ajax call). How can I ignore (or disable) any additional clicks on the button, until my ajax request finishes (or times out)? OR, is there a different best practice for this?
B
5
Posts: 8
Reputation: 241

Post » Thu Jul 17, 2014 12:23 am

try a boolean instance variable in that sprite. then go to "set boolean" to enable or disable the action
yolinux
B
18
S
5
Posts: 19
Reputation: 1,545

Post » Thu Jul 17, 2014 12:25 am

make an instance variable in the sprite button i.e. "enabled". and just add a condition to your Mouse On Clicked Event.

On Mouse Clicked Object
AND
Button Is enabled
{
button click code
}
B
97
S
32
G
16
Posts: 1,199
Reputation: 16,680


Return to How do I....?

Who is online

Users browsing this forum: tarek2, Yahoo [Bot] and 56 guests