#1120:访问未定义的属性超自然HighScores

时间:2014-09-16 00:52:07

标签: actionscript-3 shared-objects

//Creates a shared object to hold the users highscores
SupernaturalHighScores = SharedObject.getLocal("SPNHighScores"); 
SupernaturalHighScores.data.Name = "Dean Winchester";
SupernaturalHighScores.data.Score = "200";
SupernaturalHighScores.flush();

trace(SupernaturalHighScores.data.Name);
trace(SupernaturalHighScores.data.Score);

1 个答案:

答案 0 :(得分:0)

你必须declare SupernaturalHighScores:

var SupernaturalHighScores:SharedObject = SharedObject.getLocal("SPNHighScores");