powered by Jive Software

Roster Visualization: From Datagrid (Array) to Tree (XML)


I am very new in ActionScript/Flash.

Let me know if there is any easy method to implement Roster.dataprovider that way as it will be compatible to Tree.dataprovider, I mean XML dataprovider.

Thanks & Regards,

Puspendu Banerjee

I was able to do this on my own. Here are the basic steps:

  1. Create a class that stores an ArrayCollection which you can map to a tree. Basically it’'s an ArrayCollection of ArrayCollections. Just look up a basic ArrayCollection -> Tree control example.

  2. Attach RosterEvent and PresenseEvent handlers to your class to maintain the collection state as the roster changes.

  3. Set the dataProvider property on your Tree control to be this ArrayCollection.

Take a look at my code here: http://www.bitkickers.com/code/sworks1.zip

Note: my implementation uses groups as the top level folders nodes, and users as the leafs. It also moves all offline users to an “Offline” group.


It would be so great if you could thought some insight…on the following…

How do you get your buddies list and update in the rooster ?.

How do I get the rooms list from the server.?