开发者

Sharedobject don't remember data?

开发者 https://www.devze.com 2023-04-08 13:15 出处:网络
I have this code for sharedobject: var mySharedObject = SharedObject.getLocal(\"republicofcode\"); mySharedObject.data.clientID = my_vars.clientID;

I have this code for sharedobject:

var mySharedObject = SharedObject.getLocal("republicofcode");
mySharedObject.data.clientID = my_vars.clientID;
mySharedObject.data.question = my_vars.question;
mySharedObject.data.answer = my_vars.answer;   
mySharedObject.flush();

Next time when I try this code:

var mySharedObject = SharedObject.getLocal("republicofcode");

Variable mySharedObject.data.clientID is undefined. I don't know why sharedobject don开发者_开发百科't remember data?


Can you try just a basic .fla to test the SharedObject functionality?

import flash.net.SharedObject;

var so:SharedObject = SharedObject.getLocal('so');

// Run once, then comment out this next line and run again.
so.data.me = 'your special data';

trace( so.data.me );

At least we can verify if this is working or not.

0

精彩评论

暂无评论...
验证码 换一张
取 消