Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Closed Thread
 
Thread Tools Display Modes
Share |
  #1  
Old 11-16-2004, 12:45 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
Question swf banner rotator

Hi,

I am looking for free banner rotator of .swf files. Does anyone know where I can find any??
 

Advertisement

Advertisement

  #2  
Old 11-16-2004, 01:45 PM
imaginemn's Avatar
imaginemn imaginemn is offline
v7n Mentor
 
Join Date: 02-18-04
Location: Brownsville, Texas
Posts: 1,354
iTrader: 0 / 0%
You could try something like this. You may want to tweak it to fit your needs but this will prove concept. Make sure the array DOES NOT WRAP.

Code:
<script language="Javascript"> <!-- var currentdate = 0 var core = 0 function StringArray (n) { this.length = n; for (var i =1; i <= n; i++) { this[i] = ' ' } } image = new StringArray(4) image[0] = '<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab #version=5,0,0,0 id=Banner><PARAM NAME=movie VALUE=flashAD.swf><PARAM NAME=quality VALUE=high><PARAM NAME=menu VALUE=false><EMBED src=flashAD.swf quality=high TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>' image[1] = 'Text only ad' image[2] = '<a href="ad.htm">Text AD</a>' image[3] = '<img src="ad.jpg">' var ran = 60/image.length function radAD() { currentdate = new Date() core = currentdate.getSeconds() core = Math.floor(core/ran) return(image[core]) } document.write(radAD()) //--> </script>
imaginemn
 
  #3  
Old 11-16-2004, 02:59 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
hey, thanks, I will try it almost imidiately :-)
 
  #4  
Old 11-16-2004, 03:13 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
hm, it is difficult for me. have you additional advice for this?
 
  #5  
Old 11-16-2004, 03:23 PM
imaginemn's Avatar
imaginemn imaginemn is offline
v7n Mentor
 
Join Date: 02-18-04
Location: Brownsville, Texas
Posts: 1,354
iTrader: 0 / 0%
Quote:
Originally Posted by nedzad
hm, it is difficult for me. have you additional advice for this?
The only thing you need to change are the following.

Step 1 update the following line.

StringArray(4)

Change the number to the number of files you are rotating.

Step 2 add your own ads

image[0] = '<OBJECT. . .' (make sure you add your own flash file in the object tags)
image[1] = '<OBJECT. . .'
image[2] = '<OBJECT. . .'

Remember JavaScript starts with 0. So the StringArray value would be then final number + 1. In this example it would be (3).

Once this is complete add this to the section of the site you want to display it in.

imaginemn
 
  #6  
Old 11-16-2004, 05:33 PM
imaginemn's Avatar
imaginemn imaginemn is offline
v7n Mentor
 
Join Date: 02-18-04
Location: Brownsville, Texas
Posts: 1,354
iTrader: 0 / 0%
I created a working sample here.

http://www.imaginemn.com/flash_ads.htm

imaginemn
 
  #7  
Old 11-17-2004, 09:37 AM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
hey it looks great. I just came from my job and after launch I will immidiately try this, if is needed whole night :-)

Thanks again

_____________________
www.proauto.ba
www.maoles.com
www.ferk.ba
www.kuca-mostar.50megs.com
www.moj-studio.com
 
  #8  
Old 11-17-2004, 12:01 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
I put this:

<script language="Javascript">
<!--
var currentdate = 0
var core = 0

function StringArray (n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '

}
}

image = new StringArray(2)
image[0] = '<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="120" height="600"><param name="movie" value="../../baneri/11.swf"><param name="quality" value="high"><embed src="../../baneri/11.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="120" height="600">></EMBED></OBJECT>'
image[1] = '<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="120" height="600"><param name="movie" value="../../baneri/12.swf"><param name="quality" value="high"><embed src="../../baneri/12.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="120" height="600">></EMBED></OBJECT>'

var rand = 100/image.length

function radAD() {
currentdate = new Date()
core = currentdate.getSeconds()
core = Math.floor(core/rand)
return(image[core])
}

document.write(radAD())

//-->
</script>


in file on:

http://www.proauto.ba

but I can not see banner change? Can you imagine why??

Thanks

Last edited by nedzad; 11-17-2004 at 12:10 PM.
 
  #9  
Old 11-17-2004, 12:11 PM
imaginemn's Avatar
imaginemn imaginemn is offline
v7n Mentor
 
Join Date: 02-18-04
Location: Brownsville, Texas
Posts: 1,354
iTrader: 0 / 0%
The code is for rotating an image everytime a person goes to the page. If you want it to rotate while the user is reading the page, additional code is required. On my online example I use the following code to refresh the page.

<script type="text/javascript">setTimeout('location.href = location.href',15000);</script>

There are a few ways to handle the rotation. This was the quickest way to do it.

imaginemn
 
  #10  
Old 11-17-2004, 01:09 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
this is about refresh complete page, but what if I wanna refresh only curent banner and replace it with another?
 
  #11  
Old 11-17-2004, 02:09 PM
Rivux's Avatar
Rivux Rivux is offline
Contributing Member
 
Join Date: 10-13-03
Location: Ontario, Canada
Posts: 425
iTrader: 0 / 0%
You could place the banner in an iframe and just refresh that iframe.
 
  #12  
Old 11-17-2004, 02:29 PM
imaginemn's Avatar
imaginemn imaginemn is offline
v7n Mentor
 
Join Date: 02-18-04
Location: Brownsville, Texas
Posts: 1,354
iTrader: 0 / 0%
The previous JavaScript was designed to print out a random banner ad each time your page is viewed.

Why not try this instead. Create a blank.swf file with the following actionscript and load that on your page. Then create all your flash banner images and name them banner1.swf, banner2.swf, etc. In this example you will always have to have 10 banners in the banners directory. You can also pass a variable to the actionscript so you don't have to hardcode the # of banners.

Please note that the following code is not complete. The code needs a way to restart and reload a new file. It can be done through actionscript. I'm sure there are better ways to do this but right now I'm running late for a meeting.

ActionScript Code:

randomNumber = random(10);
bannerToLoad = "/banners/banner" + randomNumber + ".swf";
loadMovieNum(bannerToLoad , 0);

IFrame option should work as well as Rivux mentioned.

imaginemn
 
  #13  
Old 11-19-2004, 06:29 AM
Jason's Avatar
Jason Jason is offline
Contributing Member
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 712
iTrader: 0 / 0%
Nedzad - does 50megs.com host server side includes and banner free?
 
  #14  
Old 11-21-2004, 02:25 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
I came to bosnia again :-)

I do not know does it includes banner free?
 
  #15  
Old 11-21-2004, 02:27 PM
nedzad nedzad is offline
Junior Member
 
Join Date: 08-22-04
Posts: 21
iTrader: 0 / 0%
Hey Imagine, this is great idea and you make me fieel stuipd, really!!
 
  #16  
Old 05-31-2006, 04:16 AM
tidope tidope is offline
Junior Member
 
Join Date: 05-31-06
Posts: 1
iTrader: 0 / 0%
Quote:
Originally Posted by imaginemn
The code is for rotating an image everytime a person goes to the page.
This is what i really need.... but unfrtunately i have tried the above code and it is not showing the swf banner at all on my page...

www.thevoicebw.com

I really need help how to rotate the swf banner..

TX
 
  #17  
Old 05-20-2013, 02:38 PM
J. H. Rasmussen J. H. Rasmussen is offline
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 6,003
iTrader: 1 / 100%
@tidope:
Please create a new thread with your question
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help for random banner rotator script digital_success Coding Forum 2 11-17-2006 01:22 PM
PHP Rotator SN3 Coding Forum 15 02-24-2005 06:35 PM
Banner Rotator Pimpen 2010 Coding Forum 9 05-26-2004 12:21 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:25 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC