I am new to this part of AS 3.0. I found the example by Lee Burrows. That works fine, but I need to send a complex array of objects or at least multidimensional array. And I can't get it to work.
Struggling with it for a week. Can anyone help?
Here is the parts of the code:
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;
}
}
I getting error
TypeError: Error #1034: Type Coercion failed: cannot convert Object@7bc4dd9 to fl.data.DataProvider.
It can be easily done if you convert your Array/Vector/Object to a JSON object that Flash now supports natively.