It would be better for you to assemble whole tree from the parts, dynamic ones compose out of database values, static ones out of static consts etc.
If you want to locate that 'Groups' node you could use this kind of syntax:
public var tree:XML = <root>
<node label="In Progress"/>
<node label="More Info"/>
<node label="Category 1"/>
<node label="Category 2"/>
<node label="Group 1"/>
<node label="Group 2"/>
<node label="Group 3"/>
public var groupsNode:XML = tree.descendants(hasOwnProperty('@label') && @label == 'Groups');
i couldnt get that code to work. does it matter that i'm declaring the tree in mxml rather than actionscript? your code looks like its all actionscript and part of a class?
i added this code to my app based on yours and under my init method:
var groupsNode:XML = treeData.descendants(hasOwnProperty('@label') && @label == 'Groups');
but i get a compile error:
"Attemped access of inaccessible property label through a reference with static type main."
hmmm... maybe im missing something but how do i populate the values based on the database values?
hmm, maybe like this?
var databaseValues:Array = ['db value 1', 'db value 2', 'db value 3'];
for each (var item:XML in groupsNode..node)
item.@label = databaseValues[item.childIndex()];
If you feel this message answers your question or helps, please mark it respectively
am i still using my mx:XMLListCollection? Or are you suggessting I somehow create an XML list via actionscript? i dont think the syntax you gave me will apply to my XMLListCollection in the previous posts.
it would be better for you to go with the native XML type for maintaining your tree structure.