English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to make it so when you refresh the webpage, either one of two or more flash movies will appear by random. How do I code this?

2006-12-12 15:12:43 · 2 answers · asked by mintai2003 2 in Computers & Internet Programming & Design

2 answers

If you're trying to do this with MySpace or some other blog, no chance, without Flash(see below).

There are so many question to be asnwered! Do you have Flash (the creator, not the viewer)? If so, you can create a movie clip with no content except the Actionscript to randomly choose one of a finite, predescribed list of videos.

If not, you'll need a scripting language, such as javascript, ASP, PHP, or Java(*.js). You're gonna need to know which language to use before I can give you any code. You also won't be able to test it on your computer without a server environment installed such as Apache. Once you decide on a language, you'll need to type the code to find a random number, then use that number to choose from a list, using the if (){} statement. Next, you use the document.write() method to write the entire html document, exchanging specifications with variables described in the list of movies you have.

Send me a message with what you have, and maybe I can help you. I have flash, so I can create the *.swf file for you if you have a list of movies/url's ready to go. Really, it's a pretty simple thing to do.

2006-12-12 16:16:15 · answer #1 · answered by Rockstar 6 · 0 0

http://blog.deconcept.com/2004/10/14/web-standards-compliant-javascript-flash-detect-and-embed/

2006-12-13 00:46:36 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers