473,395 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Make different swf files appear on a website when you refresh it

1
Hi

I am trying to make a html page where I have 3 swf files which I would to be shown randomly when you refresh the page.

However I can't get the code to work. I have tried to delete the javascript part and then the movies are being shown - but not in the right way. And when the javascript is there no movies are shown.

I would really appreciate if someone could help me!

Thanks!

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Untitled Document</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </head>
  6.  
  7. </body>
  8.  
  9. <script language="JavaScript">
  10.  
  11. // Generate a Random Number
  12. var randomnumber = Math.round(Math.random()*3);
  13.  
  14. // Select a movie and execute the corresponding function
  15. if (randomnumber == 1)
  16.  
  17. {movie1();}
  18.  
  19. else if (randomnumber == 2)
  20.  
  21. {movie2();}
  22.  
  23. else {movie3();}
  24.  
  25. // Functions to write out the correct flash movie resource.
  26.  
  27. function movie1(){
  28. document.write("<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="233">
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.     <param name="movie" value="http://www.wiseentertainment.dk/quizformoney/Interstitials/lobby.swf" />
  37.     <param name="quality" value="high" />
  38.     <embed src="http://www.wiseentertainment.dk/quizformoney/Interstitials/lobby.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="233"></embed>
  39.   </object>")
  40. }
  41.  
  42. function movie2(){
  43. document.write("<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="233">
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.     <param name="movie" value="http://www.wiseentertainment.dk/quizformoney/Interstitials/deposit.swf" />
  52.     <param name="quality" value="high" />
  53.     <embed src="http://www.wiseentertainment.dk/quizformoney/Interstitials/deposit.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="233"></embed>
  54.   </object>")
  55. }
  56.  
  57. function movie3(){
  58. document.write("<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="233">
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.     <param name="movie" value="http://www.wiseentertainment.dk/quizformoney/Interstitials/lobby.swf" />
  67.     <param name="quality" value="high" />
  68.     <embed src="http://www.wiseentertainment.dk/quizformoney/Interstitials/lobby.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="233"></embed>
  69.   </object>")
  70. }
  71.  
  72. </script>
  73.  
  74. </html>
  75.  
May 16 '07 #1
3 2787
Motoma
3,237 Expert 2GB
This is more of a Javascript related issue than a Flash issue, so I have passed it along to the appropriate forum.
May 16 '07 #2
Motoma
3,237 Expert 2GB
Any reason why you could not do this in Flash? Just create a container movie clip which randomly loads up one of three files.
May 16 '07 #3
kestrel
1,071 Expert 1GB
that actually sounds like a better option, why hassle with all the javascript?
May 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ben | last post by:
Hi all, I'm posting this to comp.lang.php and comp.protocols.tcp-ip. I'm quite new to php. I made a simple test page in php with "_SERVER" and "_SERVER" server variables. I uploaded my page...
37
by: ajay | last post by:
How to make a web page getting refreshed after a given time interval automatically. HTML Code plz. Tx Ajay
6
by: Jeremy S. | last post by:
Sorry if this is too far OT - I posted this in the IIS group and got no response - so here goes: What would be a good or recommended way to make a Web site in IIS6 inaccessible to users on the...
12
by: pac | last post by:
I'm preparing to distribute a Windows XP Python program and some ancillary files, and I wanted to put everything in a .ZIP archive. It proved to be inordinately difficult and I thought I would...
3
by: Steven Nagy | last post by:
Hi all, ASP.NET : Framework 2.0 - C# A recent addition to my code generater will create GridView's and ObjectDataSource's in a control (ASCX). So the code gen creates an ascx, ascx.cs,...
1
by: Dooboise | last post by:
Hi. For my website, I'm trying to develop a JavaScript that makes a div appear. I have found several samples that toggle a div back and forth between visible and hidden, but what I need is a bit...
1
by: mlumsden | last post by:
OK So here's my essential Dilemma. I have set up my Table to import from 3 excel files and 1 other table. The Excel files may or may not be updated at the time of each refresh of my Table...
38
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.