arceus
arceus

Reputation: 337

Deactivating a button in corona sdk

How to deactivate a button in corona? I want a button(any image with event listener acting as a button)which can be disabled.I want to enable it later.

Upvotes: 1

Views: 99

Answers (1)

Nicklas Kevin Frank
Nicklas Kevin Frank

Reputation: 6337

You can simply remove the listener from the image:

button:removeEventListener("tap", myListener)

and then add it back when you want it to be active again.

button:addEventListener("tap", myListener)

Upvotes: 2

Related Questions