how to prevent a double tap

thanks alot for the reply

i tried the above and the button stopped working al together

however your code above made me notice something that solved my problem:

where i have written ‘onComplete = finisMove1’ and ‘onComplete = finishMove2’ in the transition.to code

i realised that by simply placing the onComplete function onto the last transition.to code of each half of the transition i was able to solve my problem.

i’ll post the code for anyone that will need it in the future

and again i thankyou alot for the help, even if it was an indirect eye opener :slight_smile:

leftEyeMovement = 1 local function event3(event) if leftEyeMovement == 1 then local function finishMove1() leftEyeMovement = 2 end leftEyeMovement = 3 button:setEnabled(false) button2:setEnabled(false) transition.to(eye2, { time = 1000, x = 30, delta = true, transition = easing.outQuad }) transition.to(leftEyeCover, { time = 1000, x = 325, delta = true, transition = easing.outQuad }) transition.to(leftEyeCover, { time = 1000, delay = 2000, x = 500, delta = true, transition = easing.outQuad }) transition.to(eye2, { time = 1000, delay = 2000, x = -30, delta = true, transition = easing.outQuad }) transition.to(eye, { time = 1000, delay = 2000, x = 30, delta = true, transition = easing.outQuad }) transition.to(leftEyeCover, { time = 1000, delay = 4000, x = -500, delta = true, transition = easing.outQuad }) transition.to(eye2, { time = 1000, delay = 4000, x = 30, delta = true, transition = easing.outQuad }) transition.to(eye, { time = 1000, delay = 4000, x = -30, delta = true, transition = easing.outQuad }) transition.to(leftEyeCover, { time = 1000, delay = 6000, x = 500, delta = true, transition = easing.outQuad }) transition.to(eye2, { time = 1000, x = -30,delay = 6000, delta = true, transition = easing.outQuad }) transition.to(eye, { time = 1000, x = 30,delay = 6000, delta = true, transition = easing.outQuad, onComplete = finishMove1 }) button3:setLabel("Please Press To Reset") end if leftEyeMovement == 2 then local function finishMove2() leftEyeMovement = 1 end leftEyeMovement = 3 transition.to(leftEyeCover, { time = 1000, x = -825, delta = true, transition = easing.outQuad }) transition.to(eye, { time = 1000, x = -30, delta = true, transition = easing.outQuad, onComplete = finishMove2 }) button3:setLabel("Alternate Test") end end button3 = widget.newButton{ label = "Alternating Test", fontSize = 30, width = 640, height = 90, left = 0, top = 750, onPress = event3 }