BUG: Transition cancel is not canceling the onComplete "queue" function list to be called

I’m using the last public version and I wonder how to cancel a transition which didn’t start?

The following doesn’t stop the transition because it starts after 1 second, so how to do?

local t1=transition.to(obj, {time=1000, onComplete=onTransitionComplete})
transition.cancel(t1)

Hi @waltsir.

In your example, the transition is not starting after 1s. To do that you would need to use the “delay” property, not the “time” property (which defines the duration of the transition).

I tested here and you can cancel a transition that didn’t start without problem. I am using the daily build 2099 and the code below:

local function onTransitionEnd(event) print("onTransitionEnd - event=", tostring(event), "event.target=", tostring(event.target)) end local rect = display.newRect(0,0,1,1) print("rect=", rect) local t1 = transition.to(rect, { delay=1500, x=50 , onComplete=onTransitionEnd }) transition.cancel(t1)

Thanks you right I made mistake between delay and time but with or without them the transition t1 is not cancelled since I see the printed text… (build 2076)

That bug was fixed on build  2013.2085.

ah ok, thank you to know this important bug is fixed :slight_smile: