Hi guys, I have a client site that I finished a few days ago, but having only tested in on the internal network, I didn't take into account the flash movie that needs to load too. Basically, I want to have the Flash movie load after everything else on the page (HTML) has loaded. Is there a bit of script or code that I can use that will basically tell someone's browser to render the flash after everything else on the page has been rendered, and not before? Anyone ever had to do something similiar in the past? Cheers Oliver.
First off does your Flash have a pre-loader? Second, I don't know how to make it load after the page renters. Just make a pre-loader and you should be fine.
I actually just sorted it... No, the flash doesn't have a preloader, but what you can do, is wrap the swf in it's own div, assign it a display:none to it, then use this <body onload="document.getElementById('DIV NAME HERE').style.display = 'block'; "> Code (markup): That worked for me.
A preloader would be ideal. There's a tutorial on how to construct one at http://www.kirupa.com/developer/mx/preloader.htm
OK... Sorry to drag this one up again guys, but I'm having some issues with this... I need the Flash to delay loading until after the page loads, but I don't have access to the .fla source files. The problem with my previous workaround, is that a JS dropdown menu is no longer working. I have removed the bit of code that I used above and the dropdown now seems to be working, but the flash is now not there (Because it's set to display:none This is sooooooooo frustrating... Any other workarounds that anyone can think of? Help would be greatly appreciated at this point...
make another flash movie. load the original flash movie into a level of the new flash movie. you can control the loading of the first flash movie from the new one. use javascript 'onload' to determine when the page is done loading. make the new flash movie a javascript object. var flashloader=document.flashmov2; use javascript to tell the new flash movie to its time to load the original flash movie. here is an example of the onload handler triggering an alert after a group of images load: http://www.moshbox.com/testing/onload-alert.html
No I don't.... But I managed to find another workaround... (Cheers for all the help though guys...) Created a new flash movie, set it to 1fps... Made 5 frames, and on the last frame, used this code... loadMovieNum("location of SWF", 0); It seems to do the trick and it's not too messy... Again, thanks guys - wouldn't have done it without all the suggestions.
sebasic--------duh! did you read my last post? plus my solution is more exact since is waits for the actual page load... ....instead of just timer based. .
Yeah, I did read the post... (And I did attempt it). But I have to confess. I am an idiot when it comes to flash and I couldn't get it to work...
Great site. Hope it helps me and you all. I've tried to solve this problem for a while now. You can use a bunch of these methods described in previous replies, but heres the catch. Any of these methods only guess when the page is loaded. I have not tried the DIV, which may work, but only suspectly. What I mean is that all of these delays, still delay when loading after the onLoad or whatever meathod you use, giving you a whitespace in the browser where the flash movie is supposed to be. I've tried a Flash/HTML embed or object to create the object in html. Then I placed a stop() in the Flash timeline at frame 1. Then, when onLoad triggers, it would call a function to play() the object as in the example below: <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=800 HEIGHT=118 id=yourflash> <PARAM NAME=movie VALUE="yourflash.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="yourflash.swf" name=yourflash swLiveConnect="True" quality=high bgcolor=#FFFFFF WIDTH=800 HEIGHT=118 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/ index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> </OBJECT> : : <BODY onload="done()"> : : (javascript) function done(){ var movie = window.document.yourflash; movie.Play(); } The only problem with this is that Netscape does not support external Javascript to Flash controls anymore. Why, I don't know. This only works in IE browsers. Maybe they will fix this in the future.