Hey Guys - I’ve got a problem setting and getting a cookie value it doesn’t seem to be doing either one:
Any suggestions would be great
In Frame 1 I have this script
getURL (“javascript:getCookie(‘status’);”);
status = status
if (getBytesLoaded()==getBytesTotal()){
gotoAndPlay(3);
}
Frame 2 is
gotoAndPlay(1);
Frame 3 is
getURL(“javascript:set_cookie( ‘status’, ‘visited’, 30 );”);
if (status == “visited”) {
gotoAndPlay(“Scene 5”, 1);
}
For Reference Here is Javascript on the html page
<script language=“JavaScript1.2” type=“text/JavaScript1.2”>
<!–
//
function flashObj() {
if(navigator.appName==“Netscape”) {
return document.embeds[0]
} else {
return window[‘flash’]
}
}
function set_cookie ( cookie_name, cookie_value,
lifespan_in_days, valid_domain )
{
var domain_string = valid_domain ?
("; domain=" + valid_domain) : ‘’ ;
document.cookie = cookie_name +
“=” + encodeURIComponent( cookie_value ) +
“; max-age=” + 60 * 60 *
24 * lifespan_in_days +
“; path=/” + domain_string ;
}
function get_cookie ( cookie_name )
{
var cookie_string = document.cookie ;
if (cookie_string.length != 0) {
var cookie_value = cookie_string.match (
‘(^|;)[\s]’ +
cookie_name +
'=([^;])’ );
return decodeURIComponent ( cookie_value[2] ) ;
}
return ‘’ ;
}
//–>
</script>