Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-07-2005, 07:14 AM   PM User | #1
esthera
Senior Coder

 
Join Date: May 2004
Posts: 1,430
Thanks: 14
Thanked 0 Times in 0 Posts
esthera can only hope to improve
have flash load after the site

Is there anyway to set it that the flash loads after the rest of the site?
esthera is offline   Reply With Quote
Old 07-07-2005, 07:25 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Why would you want to do this? You could I guess use some javascript that writes the object tags to the page. You could call an onload in the body tag though I'm not exactly sure when the onload actually loads.
_Aerospace_Eng_ is offline   Reply With Quote
Old 07-07-2005, 07:26 AM   PM User | #3
esthera
Senior Coder

 
Join Date: May 2004
Posts: 1,430
Thanks: 14
Thanked 0 Times in 0 Posts
esthera can only hope to improve
I would want to do it because it's a flash ad banner on the top and it is slowing down the whole page from loading.
esthera is offline   Reply With Quote
Old 07-07-2005, 07:53 AM   PM User | #4
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Place a span tag where you want the flash to appear.

Code:
<span id="the-ad"></span>
Then in your head tags add this
Code:
<script type="text/javascript">
<!--
function loadFlash(){
document.getElementById('the-ad').innerHTML='<object type="application/x-shockwave-flash" data="your-movie.swf" width="700" height="100">'
+'<param name="movie" value="your-movie.swf">'
+'</object>';
}
//-->
</script>
And in your body tag add this
Code:
onload="loadFlash()"
so your body tag looks like this
Code:
<body onload="loadFlash()">
or if you can don't even put the ad on the page.
_Aerospace_Eng_ is offline   Reply With Quote
Old 07-18-2005, 08:54 PM   PM User | #5
AshleyQuick
Regular Coder

 
Join Date: Jun 2002
Location: USA
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
AshleyQuick is an unknown quantity at this point
Look here:

http://answers.google.com/answers/threadview?id=27907
AshleyQuick is offline   Reply With Quote
Old 12-29-2009, 11:44 PM   PM User | #6
leontb
New to the CF scene

 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
leontb is an unknown quantity at this point
Thanx very much Aerospace!

Your script does the trick!
leontb is offline   Reply With Quote
Old 12-30-2009, 03:00 AM   PM User | #7
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
My method is outdated and I recommend doing something different. I suggest you use swfobject 2.0

It has a function that you call when you want the flash to load. I suggest placing that function in a window.onload call. You will need swfobject 2.0 for this.

Code:
<script type="text/javascript">
                        var flashvars = {};
			var params = {};
			var attributes = {};
			attributes.id = "myflash";
window.onload = function()
{
			swfobject.embedSWF("myflash.swf", "theflash", "320", "240", "9.0.0", false, flashvars, params, attributes);
}
</script>
<div id="theflash">Alternate content</div>
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||

Last edited by _Aerospace_Eng_; 12-30-2009 at 03:02 AM..
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:59 PM.


Advertisement
Log in to turn off these ads.