473,545 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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 2795
Motoma
3,237 Recognized Expert Specialist
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 Recognized Expert Specialist
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 Recognized Expert Top Contributor
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
1895
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 in tripod.co.uk as they provide free php hosting. The above variables gave me an ip address and port number. To double check, I tried few other...
37
12696
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
2614
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 Internet. My situation is that I will periodically update a ASP.NET Web application. While I am making the update (which will take only a couple of...
12
5711
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 post my solution here. Is there a better one? Suppose you have a set of files in a directory c:\a\b and some additional files in c:\a\b\subdir....
3
5262
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, ascx.designer.cs and a stylesheet. The 3 control files are placed together.
1
1525
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 different. Here's the scoop: I have a series of thumbnail images. What I'd like to happen is that, when a user clicks, for example, Thumbnail Number 1, an...
1
2116
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 "Candid" (for Candidates). Each record is autonumbered (meaning every refresh the number may change, because I delete all records and refresh from the...
38
5045
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
47376
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
0
7411
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7439
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5987
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.