下面的代码在发布到FlashPlayer时正常写入。在Windows 7或XP上发布到AIR(3.9)时,它根本不写。我希望它只是我,而不是一个主要问题。与AIR。
package source
{
import flash.display.MovieClip;
import flash.net.SharedObject;
public class MAIN extends MovieClip
{
var mySO:SharedObject = SharedObject.getLocal("myThing","/")
public function MAIN()
{
var thing:int = 12;
mySO.data.sharedthing = thing;
mySO.flush();
}
}
}
答案 0 :(得分:0)
供将来参考:
使用 AIR 发布时,SharedObject文件的位置:
Windows 7
C:\Users\<UserName>\AppData\Roaming\<swfname>\Local Store\#SharedObjects
Windows XP
C:\Documents and Settings\<UserName>\Application Data
使用 Flash Player :
Windows 7
C:\Documents and Settings\<UserName>\AppData\Roaming\Macromedia\Flash Player\#SharedObjects\4YW7LFD8\localhost
Windows XP
C:\Documents and Settings\<UserName>\Application Data\Macromedia\Flash Player\#SharedObjects\2QL2PDA2\localhost\path\to\<swf_name.swf\