Recipe 10.2. Preventing the Movie from Looping


Problem

You want to prevent a movie from looping back to the beginning when it reaches the last frame.

Solution

Add a stop( ) action to a keyframe in the final frame, or set the HTML loop parameter/attribute to false.

Discussion

You can prevent a movie from looping by using a stop( ) action or by using HTML attributes to control the movie.

To use a stop( ) action, complete the following steps:

  1. If you haven't already done so, add a layer for your ActionScript code to the timeline. Give the layer a label of Actions.

  2. Insert a keyframe in the Actions layer at the final frame within the timeline. To add a keyframe, choose Insert Keyframe, or press F6.

  3. Add the stop( ) action by typing it into the Script pane.

To use HTML to prevent looping, create/change the loop parameter in the <object> tag, so that its value is false (e.g., <param name="loop" value="false">). Likewise, set the <embed> tag's loop attribute to false. As noted in Recipe 10.1, generally, using a stop( ) action is preferred over relying on HTML attributes.

See Also

Recipe 10.1, Recipe 21.1




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net