This content has been marked as final. Show 3 replies
One of the options you have now for dynamically building a Tree using AS Objects is ArrayCollection dataProvider for Tree.
// 1. create a new ArrayCollection
private var ac:ArrayCollection = new ArrayCollection();
// 2. use ArrayCollection's addItem to add Objects to the dataProvider
// 3. finally set the Tree's dataProvider to the newly constructed ArrayCollection
myTree.dataProvider = ac;
After posting this message I did a bit more digging and discovered the ITreeDataDescriptor interface. There is an example in the flex doc about creating a custom datadescriptor.
In my case I have a variety of object hierarchies I want to display in a tree so my soution was to create a wrapper object the implements the methods (i.e. children) that the tree data descriptors
expect. I also created my own dataDescriptor so give me more control over addChild and removeChild operations.
I have a question regarding theDIRECT BINDING of a string value to a class name dynamically in Flex.I have to create an instance of the class based on the String value i get inside a function,which is like the STRING is same as the ClassName in .But still Iam unable to instantiate and am failing to convert the string to he class name. Iwas trying to achieve this but did'nt find any methos in the API also.
If anyone has got it working can you guz pls help me achieve it.