Embedding flash banner

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Ideas Centre
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Embedding flash banner

Post by stokerpiller »

Hello,

I have never used flash on any of my sites, basicly because I find it annoying :mrgreen:
But I have sold an ad and the customer want a swf banner to be used.

I am using this to keep it valid.

Code: Select all

<object type="application/x-shockwave-flash" data="banner.swf" width="120" height="60">
	<param name="movie" value="banner.swf" />
</object>
Its working fine, but in Firefox it seems like the swf is slowing the load of the rest of the page.

How do I embed swf and still make sure that everything loads nice and easy before the swf file loads?
I am done with phpBB
efficacious
Registered User
Posts: 355
Joined: Thu Aug 02, 2007 5:25 am
Location: 127.0.0.1

Re: Embedding flash banner

Post by efficacious »

could it be that the swf file just has poor load handling, and is just slow?
GET YOUR OWN CUSTOM STYLE PM ME

Recent works:
http://www.phpbb.com/community/viewtopi ... 4&t=633545
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

efficacious wrote:could it be that the swf file just has poor load handling, and is just slow?
I dont think so, there is no problem in Internet Explorer 7 & 8
I am done with phpBB
User avatar
Josh
Former Team Member
Posts: 1882
Joined: Sun Jan 25, 2009 3:08 pm
Location: Melbourne, AUS
Name: Josh Simpson
Contact:

Re: Embedding flash banner

Post by Josh »

try

Code: Select all

<object type="application/x-shockwave-flash" data="banner.swf" width="120" height="60">
   <param name="movie" value="banner.swf" />
   <embed src="banner.swf" width="120" height="60">
   </embed>
</object>
Josh Simpson- Formerly known as "HardStyle"
Styles: Submission Policy | Database | Knowledge Base | Demo
Please do not PM me for personal support.
Image
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

Thanks, I will try that.
But it is not valid xhtml.


EDIT: Done, it doesnt make any difference.
I am done with phpBB
User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Embedding flash banner

Post by prototech »

In overall_header.html, find:

Code: Select all

</head>
Before, add:

Code: Select all

<script type="text/javascript">
// <![CDATA[
function loadAd()
{
	document.getElementById('advertisements').innerHTML="<object type=\"application/x-shockwave-flash\" data=\"banner.swf\" width=\"120\" height=\"60\"><param name=\"movie\" value=\"banner.swf\" /></object>";
}

onload_functions.push('loadAd()');
// ]]>
</script>
Then simply add the following where you want the advertisement to appear:

Code: Select all

<div id="advertisements"></div>
What this basically does is insert the the html for the advertisement into the div once the page is loaded.
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

Thanks prototech.
Actually I have 2 banners.
So I need to know how to ad an extra swf file to the script.
I am done with phpBB
User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Embedding flash banner

Post by prototech »

Are they in completely different areas or right below/next to each other?
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

Well, one is in overall_header.html and the other is in index_body.html
Between the is the entire forumlist.
I am done with phpBB
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

I have checked the code using only one banner and it doesnt work.
The banner doesnt show up.
I am done with phpBB
User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Embedding flash banner

Post by prototech »

Which browser are you using? Can you post a link to the board where the code is live?
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

Firefox and IE.
I can give you a link, but would like to be sure that everything is done correct first.

banner.swf Should this be located in root or the template folder?
I am done with phpBB
User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Embedding flash banner

Post by prototech »

With the code that you posted, it should be in the board's root.
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Embedding flash banner

Post by stokerpiller »

Thanks for the help prototech.

It is working on my testsite, so I must have made an error when implementing it to my live site.
Any solution for using this with 2 banners?
I am done with phpBB
User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Embedding flash banner

Post by prototech »

Code: Select all

<script type="text/javascript">
// <![CDATA[
function loadAd()
{
	var ads = new Array();
	ads[0] = {id:"advertisements", source:"banner.swf", width:"120", height:"60"};
	ads[1] = {id:"advertisements2", source:"another_banner.swf", width:"100", height:"50"};
	
for (var i = 0; i < ads.length; i++)	
	document.getElementById(ads[i].id).innerHTML="<object type=\"application/x-shockwave-flash\" data=\"" + ads[i].source + "\" width=\"" + ads[i].width + "\" height=\"" + ads[i].height + "\"><param name=\"movie\" value=\"" + ads[i].source + "\" /></object>";
}

onload_functions.push('loadAd()');
// ]]>
</script>
If you need to add more, simply add another key to the array. For example:

Code: Select all

ads[2] = {id:"div_id", source:"ad_banner.swf", width:"100", height:"50"};
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.
Locked

Return to “[3.0.x] Styles Support & Discussion”