PDA

View Full Version : Completely Fascinating Question



suction cup
11-26-2010, 03:08 PM
Hello, :)

Can any of you cats help out here and glance over this script? It doesn't work - there's probably something blatant that I've missed. :rolleyes:

It's meant to load one of a selection of swfs and gifs, on page load. It's based on this from the archive: http://www.dynamicdrive.com/forums/archive/index.php/t-13723.html

Thanks so much, a little script follows: :eek:


<head>
<title>
flash ah-ha
</title>
<meta name="GENERATOR" content="Arachnophilia 5.4"/>
<meta name="FORMATTER" content="Arachnophilia 5.4"/>


<script language="JavaScript" type="text/javascript">
<!-- Hide from browsers that do not support JavaScript

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------


function letsGo();

// Version check based upon the values entered above in "Globals"

var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Check to see if the version meets the requirements for playback

if (hasReqestedVersion) {

// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
// Generate a Random Number

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 if (randomnumber == 3)

{anime1();}

function movie1(){
AC_FL_RunContent(
"src", "/images/withLeaves",
"play", "true",
"width", "980",
"height", "323",
"align", "middle",
"wmode", "opaque",
"id", "/images/withLeaves",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "/images/withLeaves",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
"pluginspage", "http://www.macromedia.com/go/getflashplayer"
)
}

function movie2(){
AC_FL_RunContent(
"src", "/images/withLeaves2",
"play", "true",
"width", "980",
"height", "323",
"align", "middle",
"wmode", "opaque",
"id", "/images/withLeaves2",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "/images/withLeaves2",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
"pluginspage", "http://www.macromedia.com/go/getflashplayer"
)
}

function anime1() {
var anime1 = '<img src="/images/animation.gif" width="980" height="323" border="0"></a>';
document.write(anime1);
}

else {

// flash is too old or we can't detect the plugin

var alternateContent2 = '<img src="/images/animation4.gif" width="980" height="323" border="0"></a>';
document.write(alternateContent2); // insert non-flash content
}

// -->
</script>
</head>

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<script language="JavaScript" type="text/javascript">
<!--
letsGo()
--->
</script>

</body>
</html>