...

View Full Version : Audio banners



debbie29
07-19-2006, 10:05 PM
Hey all!

Didn't know where this post should go.. but here it is!

I need to post this audio banner, but it keeps coming up as a broken image. It is a swf file.

How do I do that? Are there any different file formats I can change it to..or?

Deb

_Aerospace_Eng_
07-20-2006, 12:46 AM
Can you setup a test page somewhere?

debbie29
07-20-2006, 07:34 AM
This is a little sample of the simple banner rotator I use. I have never had to use any audio banners before, so this is totally new to me.

<TD align="center">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin >
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://www.tomiswickmusic.com";
alt="Tomi Swick";
banner="http://www.popyoularity.com/banners/tomi_swick-banner2.swf";;
width="468";
height="60";


}


Does that help at all without setting up a test page?
If not, I'll definitely set one up!


Thank you!!

Debbie

_Aerospace_Eng_
07-20-2006, 07:54 AM
How many audio banners do you have and how often will they need to rotate? On page load? To put the ad on your page all you do is use this

<object type="application/x-shockwave-flash" data="http://www.popyoularity.com/banners/tomi_swick-banner2.swf" width="468" height="60">
<param name="movie" value="http://www.popyoularity.com/banners/tomi_swick-banner2.swf">
</object>

debbie29
07-20-2006, 07:57 AM
3 -- only one is audio. The other two are just regular banners.

D

debbie29
07-20-2006, 07:58 AM
Here's the full code that is used:



<TD align="center">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin >
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://www.tomiswickmusic.com";
alt="Tomi Swick";
banner="http://www.popyoularity.com/banners/tomi_swick-banner2.swf";;
width="468";
height="60";


}


if (ad==2) {
url="http://www.billytalent.com";
alt="Billy Talent";
banner="http://www.popyoularity.com/banners/billytalent.gif";
width="468";
height="60";
}




if (ad==3) {
url="http://www.billytalent.com";
alt="Billy Talent";
banner="http://www.popyoularity.com/banners/billytalent.gif";
width="468";
height="60";
}

document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('</center>');

<!-- End -->
</SCRIPT>

_Aerospace_Eng_
07-20-2006, 07:59 AM
How often will they need to be rotated? Everytime the page is refreshed or what? Will you want them to rotate randomly? That first one isn't going to show up well simply because its not an image its a flash file.

debbie29
07-20-2006, 08:10 AM
oh sorry-- forgot that part. It loads a new banner each time the page is refreshed.

I just don't undertand how to properly link the flash file...

Debbie

debbie29
07-20-2006, 08:11 AM
Ugh! forgot another thing! --randomly rotate.

_Aerospace_Eng_
07-20-2006, 08:15 AM
Okay give me a few minutes.

debbie29
07-20-2006, 08:47 AM
great!! thanks!

_Aerospace_Eng_
07-20-2006, 08:53 AM
Here you go

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
var numbanners = 3; // this is the number of banners you will have
var banWidth = '468'; // this is the banner width
var banHeight = '60'; // this is the banner height
var thebanners = new Array();
thebanners[0] = "http://www.popyoularity.com/banners/tomi_swick-banner2.swf";
thebanners[1] = "http://www.popyoularity.com/banners/billytalent.gif";
thebanners[2] = "http://www.popyoularity.com/banners/billytalent.gif";

function loadBanner()
{
var ran = parseInt(Math.random() * numbanners);
var obj = thebanners[ran];
alert(obj);
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'swf')
{
document.getElementById('mediahold').href = "http://www.tomiswickmusic.com";
document.getElementById('mediahold').innerHTML = '<object type="application/x-shockwave-flash" data="'+obj+'" width="'+banWidth+'" height="'+banHeight+'">'
+'<param name="movie" value="'+obj+'">'
+'<\/object>';
}
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'gif' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'jpg' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'png')
{
if(ran != 0) document.getElementById('mediahold').href = "http://www.billytalent.com";
var theimg = document.createElement('img');
theimg.src = obj;
theimg.width = banWidth;
theimg.height = banHeight;
theimg.alt = "http://www.billytalent.com";
theimg.border = "0";
document.getElementById('mediahold').appendChild(theimg);
}
}
window.onload = loadBanner;
</script>
</head>

<body>
<div><a id="mediahold"></a></div>
</body>
</html>

The .swf one is a pretty large file fyi.

debbie29
07-20-2006, 09:03 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
var numbanners = 3; // this is the number of banners you will have
var banWidth = '468'; // this is the banner width
var banHeight = '60'; // this is the banner height
var thebanners = new Array();
thebanners[0] = "http://www.popyoularity.com/banners/tomi_swick-banner2.swf";
thebanners[1] = "http://www.popyoularity.com/banners/billytalent.gif";
thebanners[2] = "http://www.popyoularity.com/banners/billytalent.gif";

function loadBanner()
{
var ran = parseInt(Math.random() * numbanners);
var obj = thebanners[ran];
alert(obj);
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'swf')
{
document.getElementById('mediahold').href = "http://www.tomiswickmusic.com";
document.getElementById('mediahold').innerHTML = '<object type="application/x-shockwave-flash" data="'+obj+'" width="'+banWidth+'" height="'+banHeight+'">'
+'<param name="movie" value="'+obj+'">'
+'<\/object>';
}
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'gif' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'jpg' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'png')
{
if(ran != 0) document.getElementById('mediahold').href = "http://www.billytalent.com";
var theimg = document.createElement('img');
theimg.src = obj;
theimg.width = banWidth;
theimg.height = banHeight;
theimg.alt = "http://www.billytalent.com";
theimg.border = "0";
document.getElementById('mediahold').appendChild(theimg);
}
}
window.onload = loadBanner;
</script>
</head>

<body>
<div><a id="mediahold"></a></div>
</body>
</html>

debbie29
07-20-2006, 09:05 AM
Whoops!

Accidently hit post.


Anyways...

I tried it out, but the banners disappear, and a pop up appears with the file's link.. the music will even start playing.. but no banner appears. Even the regular banner wont appear. Same thing happens...

D

_Aerospace_Eng_
07-20-2006, 09:07 AM
I've tested the script locally and it works just fine so I'm not sure what the problem is. Its likely a problem with your computer. I accidently left this line in there

alert(obj);
remove it and that alert will go away. The banners should be showing though.

debbie29
07-20-2006, 09:14 AM
no alert now, but its still doing the same thing..

See?: http://www.popyoularity.com/templates/indextest.shtml

D

debbie29
07-20-2006, 09:16 AM
Usually the banner shown is on the right side-- and the rotating ones are beside it on the left.

D

_Aerospace_Eng_
07-20-2006, 09:28 AM
Okay it appears that your html knowledge isn't too strong as you just copy and pasted the entire thing I gave you into your page. Don't do that, just place this in between your head tags

<script type="text/javascript">
var numbanners = 3; // this is the number of banners you will have
var banWidth = '468'; // this is the banner width
var banHeight = '60'; // this is the banner height
var thebanners = new Array();
thebanners[0] = "http://www.popyoularity.com/banners/tomi_swick-banner2.swf";
thebanners[1] = "http://www.popyoularity.com/banners/billytalent.gif";
thebanners[2] = "http://www.popyoularity.com/banners/billytalent.gif";

function loadBanner()
{
var ran = parseInt(Math.random() * numbanners);
var obj = thebanners[ran];
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'swf')
{
document.getElementById('mediahold').href = "http://www.tomiswickmusic.com";
document.getElementById('mediahold').innerHTML = '<object type="application/x-shockwave-flash" data="'+obj+'" width="'+banWidth+'" height="'+banHeight+'">'
+'<param name="movie" value="'+obj+'">'
+'<\/object>';
}
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'gif' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'jpg' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'png')
{
if(ran != 0) document.getElementById('mediahold').href = "http://www.billytalent.com";
var theimg = document.createElement('img');
theimg.src = obj;
theimg.width = banWidth;
theimg.height = banHeight;
theimg.alt = "http://www.billytalent.com";
theimg.border = "0";
document.getElementById('mediahold').appendChild(theimg);
}
}
window.onload = function()
{
loadBanner();
goforit();
}
</script>
Get rid of this

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
var numbanners = 3; // this is the number of banners you will have
var banWidth = '468'; // this is the banner width
var banHeight = '60'; // this is the banner height
var thebanners = new Array();
thebanners[0] = "http://www.popyoularity.com/banners/tomi_swick-banner2.swf";
thebanners[1] = "http://www.popyoularity.com/banners/billytalent.gif";
thebanners[2] = "http://www.popyoularity.com/banners/billytalent.gif";

function loadBanner()
{
var ran = parseInt(Math.random() * numbanners);
var obj = thebanners[ran];
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'swf')
{
document.getElementById('mediahold').href = "http://www.tomiswickmusic.com";
document.getElementById('mediahold').innerHTML = '<object type="application/x-shockwave-flash" data="'+obj+'" width="'+banWidth+'" height="'+banHeight+'">'
+'<param name="movie" value="'+obj+'">'
+'<\/object>';
}
if(obj.substr(obj.length - 3, obj.length).toLowerCase() == 'gif' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'jpg' || obj.substr(obj.length - 3, obj.length).toLowerCase() == 'png')
{
if(ran != 0) document.getElementById('mediahold').href = "http://www.billytalent.com";
var theimg = document.createElement('img');
theimg.src = obj;
theimg.width = banWidth;
theimg.height = banHeight;
theimg.alt = "http://www.billytalent.com";
theimg.border = "0";
document.getElementById('mediahold').appendChild(theimg);
}
}
window.onload = loadBanner;
</script>
</head>

<body>
<div><a id="mediahold"></a></div>
</body>
</html>
and put this where you want the banner to appear

<a id="mediahold"></a>
Change this

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="goforit()">
to this

<body style="margin:0;padding:0">
In the future its best to post a link to your site if you have one to avoid problems like this. You had a script conflicting with the one I wrote.

debbie29
07-20-2006, 10:13 AM
okay... Its showing up!

One last question.. i hope!
What would make the banner favor that stupid top spot. when I go to move it down below, it disappears again, but music plays!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum