Den her virker fint.
<html>
<head>
<title>Skip Intro Cookie</title>
<SCRIPT LANGUAGE=\"JavaScript\">
function whichObj(objName) {
if(navigator.appName==\"Netscape\") {
return document[objName]
} else {
return window[objName]
}
}
function incCookie(cookieName) {
var expdate = new Date ();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 30)); // Expires in 30 days
var expires = \"; expires=\" + expdate.toGMTString();
cookie = readCookie (cookieName)
if (cookie) {
cookie = \"Skip Intro\"
} else {
cookie = \"Play Intro\";
}
document.cookie=cookieName+\"=\"+cookie+expires;
}
var playintro = 1;
function getCookie(cookieName) {
option = readCookie (cookieName)
if(option ==\"Skip Intro\") playintro = 0;
if(option ==\"Play Intro\") playintro = 1;
}
function readCookie (cookieName) {
/* Check if we have any cookies at all... */
if(document.cookie) {
/* Check if we have the favorites cookie... */
index = document.cookie.indexOf(cookieName)
if (index != -1) {
/* Find the start */
cookieStart = (document.cookie.indexOf(\"=\", index) + 1)
/* Find the end */
cookieStop = document.cookie.indexOf(\";\", index)
if (cookieStop == -1) { cookieStop = document.cookie.length }
/* with the start and the end... now you\'ve got the whole thing */
return document.cookie.substring(cookieStart, cookieStop)
}
}
return null;
}
</SCRIPT>
</head>
<body onLoad=\"incCookie(\'FlashCookie\')\" text=\"#FFFF00\" bgcolor=\"#000000\">
<center>
<OBJECT ID=\"cookieintro\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"
http://active.macromedia.com/flash2/cabs/swflash.cab#version=3,0,0,0\"
width=\"480\" height=\"160\">
<PARAM name=\"Movie\" value=\"cookieintro.swf\">
<PARAM NAME=\"BGColor\" VALUE=\"#000000\">
<PARAM NAME=\"Quality\" VALUE=\"High\">
<PARAM NAME=\"SCALE\" value=\"exactfit\">
<PARAM NAME=\"Loop\" VALUE=\"False\">
<PARAM NAME=\"Play\" VALUE=\"True\">
<EMBED SRC=\"cookieintro.swf\"
swLiveConnect=\"true\"
name=\"cookieintro\"
LOOP=false
WIDTH=480
HEIGHT=160
QUALITY=high
BGCOLOR=#000000
TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"
http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"> </EMBED>
</object>
<br><br>
<SCRIPT LANGUAGE=JavaScript>
<!--
// Checks to make sure the movie is 100% loaded.
for(i=0; i<32767; i++) {
if(whichObj(\'cookieintro\').PercentLoaded() == 100) {
getCookie(\"FlashCookie\");
if(playintro) {
whichObj(\'cookieintro\').TGotoLabel(\'_level0\',\'IntroStart\');
document.write(\"<b>First time Visit so Intro will be played.</b>\");
} else {
whichObj(\'cookieintro\').TGotoLabel(\'_level0\',\'IntroDone\');
document.write(\"<b>Second time visit so Intro will NOT be played.</b>\");
}
break;
}
if(i == 32767) alert(\"Error loading clock!\\n\\nClick your browser Reload.\");
}
//-->
</SCRIPT>
</center>
<h2>REMEMBER: You can only transfer to a frame label if that frame is loaded.</h2>
<h3><ul>To use this script:<br>
<li>Replace \'yourmoviename\' with the name you gave your movie in the object or embed tag.
<li>Make sure that you movie has a label at the begining and end of the intro.
<li>Replace \'IntroStart\' and \'IntroDone\' with your labels.
<li>Uncomment the \'TGotoLabel\' statements and comment out the document statements.
<li>The expiration date is set for current date + 30 days. Change this if you like.
</ul>
</h3>
</center>
</body>
</html>
Du skal så i din flashfilm ave 2 framelabels.
1: \"IntroStart\"
2: \"IntroDone\"
/Nikolaj
http://www.fotx.net/nikolajdu