polite downloading

4 views
Skip to first unread message

Nick

unread,
Apr 14, 2009, 7:15:45 AM4/14/09
to SWFObject
Is it possible with SWFObject, to load/play/reveal the flash movie
once all the other files (html, images etc) associated with an HTML
page have fully loaded?

The problem is I am using a transparent background in the flash, and I
have a fairly large (filesize) transparent background loading through
CSS and the flash loads before the image and it looks a bit funky.

I know some rich media advertising platforms (like eyeblaster) only
load the flash banners after the pages has fully loaded, they refer to
it as polite loading, but I wasn't sure if this was compatible with
SWFObject.

Any ideas would be much appreciated.

Aran Rhee

unread,
Apr 14, 2009, 8:18:55 AM4/14/09
to swfo...@googlegroups.com
Sounds like you want swfobject.addLoadEvent(fn)
(http://code.google.com/p/swfobject/wiki/api )

Call your swfobject.embedSWF() inside the loadEvent function and you should
be all good to go.

A test page is here:
http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_api_addloadeven
t.html


Cheers,
Aran

Nick

unread,
Apr 14, 2009, 9:33:46 AM4/14/09
to SWFObject
Thanks for your quick reply Aran

It's my first time using SWFObject 2, but I got there in the end. Here
is my javascript code that facilitates the polite loading:

<script type="text/javascript">
swfobject.addLoadEvent(loadFlash);//the function that puts the
polite load on
var flashvars = {};
var params = {};
params.quality = "best";
params.wmode = "transparent";
var attributes = {};
attributes.id = "home";
function loadFlash() {
//The regular swf object function nestled in the polite load
function
swfobject.embedSWF("flash/home.swf", "flash_home", "979", "366",
"6.0.0", "flash/expressInstall.swf", flashvars, params, attributes);
}
</script>

I do have 1 final question - when all the page assets are loading, the
flash is represented as a big white block. Does anyone know if it is
possible to make this transparent during the polite load?

Thanks for your help.

Aran Rhee

unread,
Apr 14, 2009, 7:46:02 PM4/14/09
to swfo...@googlegroups.com
Nick.

You have already defined wmode=transparent which should remove the standard
background color in the Flash file. I am unsure what else is in your swf in
regards to artwork which might be showing the white color. A preloader will
help to ensure you are showing what you want to the user when the content is
loading.

Also, I would reverse the code definition order to define the loadFlash()
function before you call swfobject.addLoadEvent(loadFlash). It is good
practice to define the functions you are going to call before you are
calling them to ensure they are available...


Aran

-----Original Message-----
From: swfo...@googlegroups.com [mailto:swfo...@googlegroups.com] On
Behalf Of Nick
Reply all
Reply to author
Forward
0 new messages