Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to

Status
Not open for further replies.

walkities

Technical User
Oct 4, 2004
31
CA
Pull flash files from a certain folder on the web server? I have flash banner ads and I was wondering if it was possible to randomize banner ads within a certain directory? Ive been able to accomplish it with images but not with .swf files...

Can someone point me in the right direction?

Thanks
 
How are you putting the objects on the page?

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Right now its just a regular Object tag...but I was hoping to find a javascript that randomly displayed flash files from a certain folder on the webserver.
 
Something like this?
Code:
<html>
<head>
<script type="text/javascript">
<!--

var srcs = new Array("/flash/flash1.swf", "/flash/flash2.swf", "/flash/flash3.swf");

function chooseFlash()
{
  var obj = document.getElementById("flash");
  var src = srcs[Math.floor(Math.random()*srcs.length)];
  obj.code = src;     // it's one of these, 
  obj.src = src;      // just use whatever attribute
  obj.data = src;     // represents the
  obj.codebase = src; // source
}

// -->
</script>
</head>
<body>
<object id="flash" ...>
 <param ...>
 <param ...>
 <param ...>
 <embed id="flash" ...>
</object>
</body>
</html>

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top