stop()

Description

Stop all animations on the object. This will clear all the animations from the queue for this object, without setting any end values.

Return Value

displayObject. Returns the display object itself.

Examples

Example 1

We create a new core instance and a rectangle that we add to the canvas. Then we bind an event handler to the rectangle, which will change the fill color to green when clicked. It will also clear the animation queue and start an animation, that will rotate the rectangle 360 degrees. With the callback we specify that the fill color should be red when the animation is complete. The stop() method makes the result a bit more expected than it would be without (see the example of the animate() method). Try clicking on the rectangle while it is animating.