Type Function Library transition.* Return value none Revision Release 2022.3683 Keywords easing, animation, transition, tween, interpolation See also Transitions (guide)
The transition.cancel()
function will cancel one of the following, depending on the passed parameter:
transition.cancel() transition.cancel( transitionReference ) transition.cancel( displayObject ) transition.cancel( tagName )
The specific transition to cancel.
DisplayObject. The display object upon which all associated transitions will be cancelled.
String. The tag name; all transitions with this tag will be cancelled.
-- cancel all running (and paused) transitions local transition1 = transition.to( currentTarget, { time=400, y=y+100, iterations=5, tag="transTag" } ) local transition2 = transition.to( otherTarget, { time=200, y=y-200, tag="transTag" } ) -- later, cancel all running transitions transition.cancel()
-- cancel a specific transition local transition1 = transition.to( currentTarget, { time=400, y=y+100, iterations=5, tag="transTag" } ) local transition2 = transition.to( otherTarget, { time=200, y=y-200, tag="transTag" } ) -- later, cancel a specific transition transition.cancel( transition1 )
-- cancel all transitions on a display object local transition1 = transition.to( currentTarget, { time=400, y=y+100, iterations=5, tag="transTag" } ) local transition2 = transition.to( otherTarget, { time=200, y=y-200, tag="transTag" } ) -- later, cancel all transitions on the object 'otherTarget' transition.cancel( otherTarget )
-- cancel all transitions with a specific tag local transition1 = transition.to( currentTarget, { time=400, y=y+100, iterations=5, tag="transTag" } ) local transition2 = transition.to( otherTarget, { time=200, y=y-200, tag="transTag" } ) -- later, cancel all transitions with the tag "transTag" transition.cancel( "transTag" )