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 fil开发者_如何学运维e, 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
I don't see why you would need to copy the tree or the data in this scenario. Just get the XML data from the tree via its "dataProvider" property and write it to a file.
精彩评论