我正在尝试将名称和分数添加到数据网格中。我不断收到错误...
1046 类型未找到或不是编译时常量:DataProvider。1080 调用可能未定义的方法 DataProvider
这是我的编码...
var scoreArray = new Array();
D_G.addColumn("player");
D_G.addColumn("score");
enter_btn.addEventListener(MouseEvent.CLICK, saveScore);
function saveScore(event:MouseEvent):void
{
var obj:Object = new Object();
obj.player = tb_name.text;
obj.score = int(tb_score.text);
scoreArray.Push(obj);
scoreArray.sortOn("score", Array.DESCENDING | Array.NUMERIC);
var dp:DataProvider = new DataProvider (scoreArray);
D_G.dataProvider = dp;
}