PDA

View Full Version : use data provider of existing tree to populate new tree?


Paulskii
09-18-2008, 08:01 PM
Hey Guys,

I have a tree component that I am trying to duplicate without calling the xml used to populate the first one...I would like to know if its possible to use the dataProvider property of the first tree component to populate the new component...

I have a movieclip in my library that contains a tree component...the movieclip is called TreeHolder and the tree component within it is menuTree...

There is already a tree component mc that has been populated with data on the stage...this mc is called oldTree with menuTree tree component inside


_root.attachMovie("TreeHolder", "newTreeHolder", _root.getNextHighestDepth());
_root.TreeHolder.dataProvider = oldTree.menuTree.dataProvider;


This doesnt seem to work...I tried to do _root.TreeHolder.dataProvider = oldTree.menuTree.dataProvider.firstChild; But that doesnt work either...

I traced oldTree.menuTree.dataProvider and it shows the xml data just fine...

How can I do this without calling the original xml again?