in Flex 4, make a copy of a tree from the root node
I have inherited a Flex air project and have not worked with trees before.  The tree is displaying an xml file hierarchically.  The user can make a change to the data.  I need to save the data of the entire tree to a file.

I can save the *currently selected* item to a file, no problem. But I need to save all the data from the root of the tree, forward.  

I would think I could make a copy of the tree, and set the selected item of my new tree to root, or something.  Sort of like this pseudo code:


var treeToSave:Tree = new Tree (editedTree);

treeToSave.selectedIndex = 0;

// now save treeToSave to file...

This creates a compile error, but hopefully you can see what I'm trying to do.  I may be missing something conceptually here, any help appreciated.  Thanks

in Flex 4, make a copy of a tree from the root node
===

I have inherited a Flex air project and have not worked with trees before.  The tree is displaying an xml file hierarchically.  The user can make a change to the data.  I need to save the data of the entire tree to a file.

I can save the *currently selected* item to a file, no problem. But I need to save all the data from the root of the tree, forward.  

I would think I could make a copy of the tree, and set the selected item of my new tree to root, or something.  Sort of like this pseudo code:


var treeToSave:Tree = new Tree (editedTree);

treeToSave.selectedIndex = 0;

// now save treeToSave to file...

This creates a compile error, but hopefully you can see what I'm trying to do.  I may be missing something conceptually here, any help appreciated.  Thanks
