我是 AS 3.0 的这一部分的新手。我找到了 Lee Burrows 的例子。这很好用,但我需要发送一个复杂的对象数组或至少是多维数组。我无法让它工作。
挣扎了一周。任何人都可以帮忙吗?
以下是部分代码:
private function netHandler(event:NetStatusEvent):void
{
//update UI
outputText.text += "[EVENT]\n" + event.info.code + "\n";
//handle event
switch (event.info.code)
{
//connection succeeded so setup a group
case "NetConnection.Connect.Success" :
ns1 = new NetStream(netConn);
setupGroup();
break;
//group setup succeeded so enable submit
case "NetGroup.Connect.Success" :
submitButton.enabled = true;
break;
//posting received so add to output
case "NetGroup.Posting.Notify" :
var myObjectList:Array = new Array();
myObjectList = event.info.message;
dl.dataProvider = myObjectList[0];
dl.rowCount = myObjectList[0].length;
gd.dataProvider = myObjectList[1];
gd.rowCount = myObjectList[1].length;
outputText.text += "[RECEIVED]\n" + event.info.message.txt + "\n";
break;
}
}
我收到错误
TypeError:错误 #1034:类型强制失败:无法将 Object@7bc4dd9 转换为 fl.data.DataProvider。