How to Stop SWF From Looping
A loop in a digital video or animation replays the content continuously, usually until the user closes the document window. In Adobe Flash, a leading animation program, when you export to Flash's Small Web Format, or SWF, the movie is set to loop by default. Stop a movie from looping by adding a Stop action, which is an ActionScript command, to the movie's timeline.
Instructions
-
-
1
Open the Flash movie FLA in which you want to add a Stop action. Click the "File" menu and choose "Open." This displays the Open dialog box. Navigate to the file, select it and choose "Open."
-
2
Click the "New Layer" button in the lower left corner of the Timeline panel to create a new layer.
-
-
3
Double-click the new layer's name in the Timeline panel to select, then type "Actions." Name your ActionScript layer anything you want, but naming it "Actions" is a widely accepted practice.
-
4
Go to the last frame on the Actions layer, or the frame where you want the movie to stop, right-click it and choose "Insert Keyframe" from the popup menu.
-
5
Click the "Window" menu and choose "Actions." This opens the Actions panel. Use this panel to compose ActionScript code for your movie.
-
6
Make sure the Playhead is in the desired frame on the Actions layer. The Playhead is a little red box at the top of the Timeline panel that indicates the active frame. Click the first line in the Script Pane, which is the area on the right side of the panel, and type the following code:
stop();
-
7
Test or export the movie. To test, click the "Control" Window and choose "Test Scene"; to export, click the "File" menu, choose "Export" and select "Export Move" from the flyout menu. Name the file and click "OK."
-
1
Tips & Warnings
If you're using Flash CS5 or later, you can enter a Stop action from the Code Snippets panel. Click the "Window" menu and choose "Code Snippets." Double-click the "Timeline Navigation" folder to open it, then double-click "Stop in this frame."
ActionScript is case sensitive, so you must type all scripts precisely, including the appropriate capitals and punctuation marks. Otherwise, the movie will not play.
References
Resources
- Photo Credit Comstock/Comstock/Getty Images