all groups > flash (macromedia) > march 2006 >
You're in the

flash (macromedia)

group:

Random Flash not working in IE


Re: Random Flash not working in IE tralfaz
3/17/2006 9:52:22 PM
flash (macromedia):
[quoted text, click to view]

I didn't test your html/script code but it seems to me that you could
do it a lot easier by having Flash chose the random movie. The first
swf would be just a loader with the random number generator in it that
loads up one of the 3 swfs. It could double as the preloader for the
other swf file too.
tralfaz

Random Flash not working in IE MedicanSuperwillyMan
3/17/2006 10:31:48 PM
Hi all, I'm working on a redesign of a corporate website, here's the url:
http://www.medican.com/dev

I have java script that loads a random flash movie in the upper right of this
page. It works well in Safari and Firefox on MAC/PC, but the random flash won't
load in IE. Any ideas? - Thanks in advance for any help!

BTW, here's the applicable code:

<div id="Layer3">
<script language="JavaScript">

// Generate a Random Number - change the number in red to equal the number of
movies in your selection pool
var randomnumber = Math.round(Math.random()*3);

// Select a movie and execute the corresponding function
if (randomnumber == 1)

{movie1();}

else if (randomnumber == 2)

{movie2();}

else {movie3();}

//Functions to write out the correct flash movie resource.

function movie1(){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v
ersion=4,0,2,0\" width=\"495\" height=\"262\"><param name=movie
value=\"movie1.swf\"><param name=quality value=high><embed
src=\"flash/features/movie1.swf\" quality=high
pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Ver
sion=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"495\"
height=\"262\"></embed></object>")
}

function movie2(){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v
ersion=4,0,2,0\" width=\"495\" height=\"262\"><param name=movie
value=\"movie2.swf\"><param name=quality value=high><embed
src=\"flash/features/movie2.swf\" quality=high
pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Ver
sion=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"495\"
height=\"262\"></embed></object>")
}

function movie3(){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v
ersion=4,0,2,0\" width=\"495\" height=\"262\"><param name=movie
value=\"movie3.swf\"><param name=quality value=high><embed
src=\"flash/features/movie3.swf\" quality=high
pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Ver
sion=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"495\"
height=\"262\"></embed></object>")
}

</script>
</div>
Re: Random Flash not working in IE MedicanSuperwillyMan
3/18/2006 4:47:13 AM
Re: Random Flash not working in IE tralfaz
3/20/2006 11:17:11 AM

[quoted text, click to view]

The current folder where files are expected to be found is determined
by the html, not where you load the swf files from.
Here is the current folder when you load the website..
http://www.medican.com/dev/

The feature_loader swf folder is here..
http://www.medican.com/dev/flash/features

When feature_loader.swf runs it tries to load movie1.swf or movie2.swf
or movie3.swf from the "current folder"
which is not the same place as your "feature_loader.swf" is located.
Just starting the feature_loader.swf from the flash\features folder
does not make that folder the current folder.
You will need to add the path to the folder where the 3 movie swfs are
located.
loadMovieNum("flash/features/movie" + Math.ceil(Math.random() * 3) +
".swf", 1);

tralfaz












Re: Random Flash not working in IE MedicanSuperwillyMan
3/20/2006 6:39:19 PM
Sure, I would have no problem with using a loader .swf. I have spent the last
two hours searching for the best way to do this - I've found several methods,
but haven't been able to get any to work yet.

Here is the code that I found in this forum - it worked for the person in
whose thread I found it, but it's not working for me:

loadMovieNum("movie"+(Math.ceil(Math.random()*3))+".swf", 1);

I have this code in the first frame of a file called feature_loader.swf, which
is in the same directory on my webserver as my three random swfs called
"movie1.swf", "movie2.swf", and "movie3.swf". I then inserted the file
feature_loader.swf into a php file - the url is
http://www.medican.com/dev/random.php - but it does not load any of the random
files.

If you preview http://www.median.com/dev in firefox, that is exactly what I
want to happen - but the current solution in that page (using javascript) does
not seem to work on internet explorer.

Can anybody help me with this - any help is greatly appreciated!
-Cam
Re: Random Flash not working in IE tralfaz
3/20/2006 6:42:01 PM
[quoted text, click to view]

great! glad it worked.
tralfaz

Re: Random Flash not working in IE MedicanSuperwillyMan
3/20/2006 11:42:38 PM
Whoa! That worked - thanks alot for your help! SWEEET! I haven't set up
pre-loaders yet but even without them that is a much more elegant solution than
the embedded javascript - that required alot more editing when I added more
files.

Thanks Again!
AddThis Social Bookmark Button