Here's what I have so far:
Code: Select all
List<String[]> wordList = new ArrayList<String[]>();
...
// Read from database to get res
...
// Cycle through all database results and add to wordList
wordList.add(new String[] {
res.getString("var1"),
res.getString("var2"),
res.getString("var3") });
...
ISFSObject returnObj = new SFSObject();
// ??? Which put/object should I use here ???
returnObj.putXYZ("wordList", wordList);
send("wordList", returnObj, player);
I tried putSFSObject and putSFSArray, but I get syntax and runtime errors.
I was able to use putUtfString with wordList.toString(), but I had problems converting it back to an array/dictionary in AS3. This approach feels like a clunky work-around, too. I want to make sure I'm doing it "the right way".
So... How can I pass a List or multi-dimensional array from my server extension to my client? How can I process the received object as a Dictionary? (I don't see a .toDictionary() method.)