Name

play( ) Global Function — begin the sequential display of frames in a movie

Availability

Flash 2 and later

Synopsis

play( )

Description

Invoking the play( ) function initiates the sequential display of the frames in the current main movie or movie clip. The “current” movie or movie clip is the one that bears the play( ) function invocation statement. Frames are displayed at a rate dictated by the frames per second (or FPS) setting of the entire movie, which is set under the Movie Properties (Modify Movie Frame Rate).

Once started, the playback of a movie or movie clip continues until another function invocation specifically stops the playback. All movie clips loop (begin playing again at frame 1) when the playhead reaches the end of the timeline. In a browser, however, main movies loop only if the code used to embed the movie in the HTML page specifies that the movie should loop, as determined by the LOOP attribute. (If you’re using the Publish command to embed your movie in an HTML page, set the LOOP attribute by selecting File Publish Settings HTML Playback Loop.)

See Also

gotoAndPlay( ), MovieClip.play( ), stop( )

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.