This script only works good on a PC.
I need it to Work on a Mac.
Can anyone tell me what the problem is?





//place in frame 1 layer 1
//init variables//
//60 second lifespan
var lifespan = 3600;
var cookiename = "trialperiod";
//end init variables//
function isExpired() {
var so = SharedObject.getLocal(cookiename);
var now_date = new Date();
//current date in seconds from midnight January 1, 1970
var now = Math.floor(now_date.getTime()/1000);
//if it hasn't been set yet, declare it
if (so.data.dateFirstAccessed == undefined) {
trace("created "+cookiename+".sol");
so.data.dateFirstAccessed = now;
so.data.dateLastAccessed = now;
so.data.expired = false;
}
//if the date has been set back
if (now<so.data.dateLastAccessed || now<so.data.dateFirstAccessed) {
//trace("now<so.data.dateLastAccessed");
so.data.expired = true;
}
//if it has expired naturally
if (so.data.dateFirstAccessed+lifespan<now) {
//trace("so.data.dateFirstAccessed+lifespan<now");
so.data.expired = true;
}
//trace(so.data.dateFirstAccessed);
//trace(now);
//trace(so.data.dateLastAccessed-so.data.dateFirstAccessed);
if (!so.data.expired) {
so.data.dateLastAccessed = now;
return false;
} else {
return true;
}
}
//check for expiration
function checkExpiration() {
if (isExpired()) {
//clear the checkInterval loop
clearInterval(_root.checkInterval);
//just to make sure that the expired function isnt called more than once
if (!_global.expired) {
expired();
}
_global.expired = true;
} else {
//the cookie is still active
trace("still good");
}
}
//expiration function
function expired() {
//what to do when the cookie expires
trace("expired");
gotoAndStop("expired");
}



---------------------------------------------------------------------
//place on frame 1 layer 2
if (isExpired()) {
gotoAndStop("expired");
} else {
gotoAndStop("trialperiod");
}