as3: SharedObject example

[ 2009-06-19 18:48:23 | Author: liuhuan ]
Font Size: Large | Medium | Small
as3 version:
var so:SharedObject=SharedObject.getLocal("test");
if (so.size==0) {
  // Shared object doesn't exist.
  trace("created...");
  so.data.now = new Date().time;
  so.data.hello="world";
  so.data.foo="bar";
}
var ageMS:Number = new Date().time - so.data.now;
trace("SharedObject was created " + Number(ageMS / 1000 / 60).toPrecision(2) + " minutes ago");
trace("SharedObject is " + so.size + " bytes");
for (var i:String in so.data) {
  trace(i + ":\t" + so.data[i]);
}
so.flush();
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=986

There is no comment on this article.

You can't post comment on this article.