animation.play(); // Play the animation from the currently stopped frame
animation.stop(); // Stop playing the animation and return to frame 0
animation.pause(); // Pause the animation, stopping and holding at the current frame

animation.goToAndStop(value, isFrame); // Jump to a certain point/frame and stop. IsFrame (default false) indicates whether value represents a frame or time (milliseconds)
animation.goToAndPlay(value, isFrame); // Jump to a certain point/frame and play
animation.goToAndStop(30.true); // Jump to frame 30 and stop
animation.goToAndPlay(300); // Jump to 300ms and play

animation.playSegments(arr, forceFlag); // ArR can contain two numbers or an array of two numbers. ForceFlag indicates whether the segment is forced to play immediately
animation.playSegments([10.20].false); // After playing the previous clip, play 10-20 frames
animation.playSegments([[0.5], [10.18]], true); // Play frames 0-5 and 10-18 directly

animation.setSpeed(speed); // Set the playback speed. Speed 1 indicates the normal speed
animation.setDirection(direction); // Set the playback direction. 1 indicates forward play and -1 indicates reverse play
animation.destroy(); // Delete the animation, remove the corresponding element tag, etc. When unmount, you need to call this method
Copy the code