timgerr wrote:
> Has anyone used an arraycollection with a springgraph?
> 

I played around with this just last week for an experiment..

           private function init():void {
                var p:Plan = _plan;

                _graph = new Graph();
                 var item:Item = new Item(p.id.toString());
                 item.data = p;
                 _graph.add(item);
                 add(item, _graph);

                 roamer.currentItem = item;
                 roamer.repulsionFactor = 0.4;
                roamer.showHistory = true;
                roamer.itemLimit=1000;
             }

             private function add(rootItem:Item, g:Graph):void{
                 var p:Plan = rootItem.data as Plan; 

                 for(var i:int=0; i< p.children.length; i++){
                     var c:Plan = p.children.getItemAt(i) as Plan;
                     var item:Item = new Item(c.id.toString());
                     item.data = c;
                     g.add(item);
                     g.link(rootItem, item);
                     add(item, g);
                 }
             }


<adobe:Roamer id="roamer" top="0" bottom="0" left="0" right="0" 
width="100%" height="100%"
        itemRenderer="XMLItemView"
        dataProvider="{_graph}"
        repulsionFactor="{.75}"
        autoLayout="{true}"
        doubleClickEnabled="{true}"
        autoFit="{true}"
         maxDistanceFromCurrent="10"
         />


HTH.

  - shaun

Reply via email to