我在 Air for Android 中创建了一个带有高分表的游戏,但我需要将分数保存到手机上。到目前为止,我在模拟器中有工作记分牌。我的代码如下:
import fl.data.DataProvider;
var scoreArray: Array = new Array();
dg_score.addColumn("Name");
dg_score.addColumn("Score");
tf_name.text = "Enter name here";
function addScore(evt:MouseEvent)
{
var scoreObj:Object = new Object();
scoreObj["Name"] = tf_name.text;
scoreObj["Score"] = counter.text;
//each time object is added, it is pushed to end of array
scoreArray.push (scoreObj);
//sorted by the score column, in descending order
scoreArray.sortOn("Score", Array.NUMERIC | Array.DESCENDING);
dg_score.dataProvider = new DataProvider(scoreArray);
}
有谁知道我会怎么做?谢谢