View Single Post
Old 11-17-2004, 02:29 PM   #12 (permalink)
imaginemn
v7n Mentor
 
imaginemn's Avatar
 
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,946
iTrader: 0 / 0%
Latest Blog:
None

imaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to all
Send a message via MSN to imaginemn Send a message via Yahoo to imaginemn Send a message via Skype™ to imaginemn
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
__________________
Need a project done? - Set Your Own Price!
Imagine Creative Services
- Design : Marketing : Multimedia : More
imaginemn is offline   Reply With Quote