Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: Audio banners

  1. #1
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Audio banners

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you setup a test page somewhere?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    <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>
    Last edited by _Aerospace_Eng_; 07-20-2006 at 07:57 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    3 -- only one is audio. The other two are just regular banners.

    D

  • #6
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #9
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ugh! forgot another thing! --randomly rotate.

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Okay give me a few minutes.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    great!! thanks!

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Here you go
    Code:
    <!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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #13
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <!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>

  • #14
    New Coder
    Join Date
    Sep 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #15
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    alert(obj);
    remove it and that alert will go away. The banners should be showing though.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •