--- In [email protected], "timgerr" <[EMAIL PROTECTED]> wrote:
>
> Hello all,
> I am using an array collection as a dataprovider for the Kap Lab
> (http://lab.kapit.fr/display/visualizer/Visualizer) which is like a
> spring graph.  So when I click on an end node, I get the id of the
> node. If I have an id to an object, how can find the parent object 
and
> get access to it?  Has anyone done this before?  Here is my
> ArrayCollection:
> 
> private var myDataProvider:ArrayCollection = new ArrayCollection([
> {Region:"Southwest",ID:"1", children: [
>      {Region:"Arizona",ID:"2", children: [    
>       {Territory_Rep:"Barbara Jennings", ID:"3"}, 
>         {Territory_Rep:"Dana Binn",ID:"4"}]},  
>      {Region:"Central California",ID:"5", children: [ 
>            {Territory_Rep:"Joe Smith", ID:"6"}]},  
>      {Region:"Nevada", ID:"7", children: [ 
>            {Territory_Rep:"Bethany Pittman",ID:"8"}]},  
>      {Region:"Northern California", ID:"9", children: [ 
>            {Territory_Rep:"Lauren Ipsum",ID:"10"}, 
>            {Territory_Rep:"T.R. Smith",ID:"11"}]},  
>      {Region:"Southern California",ID:'12', children: [ 
>            {Territory_Rep:"Alice Treu", ID:'13'}, 
>              {Territory_Rep:"Jane Grove",ID:"14"}]}
> ]}
> ]);

If you have FBPro, something like

var HC:HierarchicalCollectionView = HierarchicalCollectionView(new 
HierarchicalData(myDataProvider));

parentItem:Object = HC.getParentItem(yourObject);

Note that this only works if you have the _entire_ object, not just 
the ID.  It also needs to be the _same_ object, not a different 
object with the same information.

HTH;

Amy

Reply via email to