[Resolved]How do I only activate tap event once?

I want a tap event to trigger an animation, but if you tap it again while its moving, to not do anything, until its done.

[lua]local function move(event)

transition.to( thing, { time = 1000, x = 206, y = thing.y, onComplete = moveCompensation } )

end

end
thing:addEventListener(“tap”, move)[/lua]

This is what I have so far. Obviously putting thing:removeEventListener before transition.to and thing:addEventListener after it, wouldnt work cause I am calling a function from within itself.

Any ideas? [import]uid: 106739 topic_id: 18365 reply_id: 318365[/import]

How about this:

[lua]thing.isActive = true
local function moveCompensation ()

thing.isActive = true

end
local function move(event)

if thing.isActive == true then

transition.to( thing, { time = 1000, x = 206, y=thing.y, onComplete = moveCompensation } )

thing.isActive = false

end

end

thing:addEventListener(“tap”, move) [/lua]
[import]uid: 93133 topic_id: 18365 reply_id: 70403[/import]

Didn’t know I could create properties for objects just like that, thanks! [import]uid: 106739 topic_id: 18365 reply_id: 70543[/import]