Recipe 10.1. Pausing a Movie After It LoadsProblemYou want to prevent the movie from playing when it loads. SolutionInsert a stop( ) action on the first frame (or the first frame following the preloader), or, if applicable, set the play parameter/attribute in the HTML document to false. DiscussionBecause you want to pause playback automatically and immediately, rather than relying on a user-initiated event, such as a button press, you can add the stop( ) action to frame 1:
After you've used a stop( ) action, be aware that unless you create another script restarting playbackon a button, for examplethere is not necessarily a way for the user to get the movie to play again.
Although adding a stop( ) action is probably the easiest and most common way to stop a movie in the first frame, it is not the only way. You can also use HTML to prevent initial playback. To do so, set the play parameter of the <object> tag to false (for example, <param name (exp 3pod.com)=play value=false>) and likewise set the play attribute of the <embed> tag to false. The following code snippet shows the HTML code needed to embed a Flash .swf file in a web page, so that it is visible in all major browsers. The attributes needed to prevent playback are highlighted. This code is discussed in detail in Chapter 21. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http:// fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="someMovie" align="middle"> <param name (exp 3pod.com)="allowScriptAccess" value="sameDomain" /> <param name (exp 3pod.com)="movie" value="someMovie.swf" /> <param name (exp 3pod.com)="play" value="false" /> <param name (exp 3pod.com)="quality" value="high" /> <param name (exp 3pod.com)="bgcolor" value="#ffffff" /> <embed src=" someMovi.swf" play="false" quality="high" bgcolor="#ffffff" width="550" height="400" name (exp 3pod.com)="someMovie" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/ getflashplayer" /> </object> Alternatively, you can use Flash to generate the HTML that sets the play parameter to false for both the <object> and <embed> tags. To do so, use the File Publish Settings HTML Paused At Start checkbox. Generally, using stop( ) is better that relying on HTML parameters/attributes, because it works in all environments. The HTML option works only if you publish the SWF in an HTML document. If you publish the movie in a projector, or test it during authoring, HTML parameters and attributes aren't available. See AlsoRecipe 10.4, Recipe 21.1 |
Tripod >> 3pod Tips & Learning and manuals for educations