PDA

View Full Version : delay play until page loads


ronstone
03-14-2001, 09:23 PM
New to Flash, but we have created a very satisfactory piece. Immediatedly encountered a problem which must be common, but can find no resolution. Since the swf is at the top of the page, it often plays and ends before the rest of the page is completely loaded. Can anyone recommend a method (java?) of delaying play until page load is complete?
thanks

edeveloper
03-16-2001, 03:36 AM
<HTML>
<HEAD>
<TITLE>play</TITLE>

<script language="javascript">
function done(){
var movie = window.document.yourMovieName;
movie.Play();
}
</script>

</HEAD>
<BODY bgcolor="#FFFFFF" onLoad="done()">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=550 HEIGHT=400 id=yourMovieName>
<PARAM NAME=movie VALUE="play.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="play.swf" name=yourMovieName
swLiveConnect="True" quality=high bgcolor=#FFFFFF
WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/
index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>

ronstone
03-16-2001, 04:12 AM
thanks very much.

ronstone
03-16-2001, 12:59 PM
I believe this routine merely preloads the swf. Am I missing something?

edeveloper
03-16-2001, 02:49 PM
if you put a stop action in the first frame of your movie, it will not play until after the html page has loaded. if you feel that the timing is still off, you could use a setTimeOut Event:
<script language="javascript">
function done(){
var movie = window.document.yourMovieName;
//this will tell the movie to play 3 sec. after the page has loaded.
setTimeout('movie.Play()',3000);
}
</script>

</HEAD>
<BODY bgcolor="#FFFFFF" onLoad="done()">

ronstone
03-16-2001, 02:57 PM
Sure! Sorry to be slow.. just started working with flash. thanks