Since I haven't used SharedObject before, I thought it might be a challenge to try to incorporate in this. Here's what I came up with, although the number by which the total increments by may need to change, I don't think I took into account the fps of the file which in turn would effect the rate at which the total increased. As long as the total increase by around 49000 (roughly) per minute, it should be good to go. Anyways, here's my code for using a sharedObject.
PHP Code:var num = 0;
var shared;
var setInt:Number = setInterval(addToTotal, 1);
this.onLoad = function() {
shared = SharedObject.getLocal("total");
num = checkTotal();
total.text = String(shared.data.current);
trace(checkTotal());
}
function checkTotal() {
shared = SharedObject.getLocal("total");
if(shared.data.current == undefined) {
shared.data.current = 0;
}
shared.close();
return shared.data.current;
}
function addToTotal(nm:Number):Void {
shared = SharedObject.getLocal("total");
shared.data.current = num;
shared.close();
num = Math.round(num + 24.4);
total.text = String(num);
}




Reply With Quote
