Pretty simple question I think, I'm just stuck, it's probably more of
an E4X XML question. I'm trying to write a method that will expand
the node of a tree based on a string match. The xml has an attribute
label, so where that matches the string, open that node of the tree.
The main bulk of my question I think lies in how I am returning the
node where the label attribute matches the string.
First, this doesn't seem to work, this is my lame attempt to find the
matching node: xml.menuTree.*.(@label == topicString), meaning, look
for any of the sub nodes where the label attribute matches the string.
Here is my actionscript and xml dataprovider for the tree:
navTree.expandItem(xml.menuTree.*.(@label == topicString), true,
true);
var xml:XML = <veniceHelp>
<menuTree>
<folder label="Getting Started">
<folder label="About Venice" />
<folder label="Overview" />
<folder label="Logging In"/>
</folder>
<folder label="The Venice User Interface">
<folder label="The My Profile View" />
<folder label="Viewing A Selected User's
Profile" />
<folder label="The Network View" />
</folder>
<folder label="Putting Venice To Work">
<folder label="Adding Associates To Your
Network" />
<folder label="Your Profile" >
<folder label="Editing Your Profile"
topic="Edit Profile">
<folder label="Changing Your
Picture" />
<folder label="Changing Your
Description" />
<folder label="Changing Your
Personal Information" topic="Changing Your Personal Information" />
</folder>
</folder>
<folder label="Skills">
<folder label="Adding Skills"
topic="Add Skill" />
<folder label="Editing Skills"
topic="Edit Skill" />
<folder label="Marking All Skills As
Private" topic="Marking All Skills As Private" />
</folder>
</folder>
<folder label="Support"/>
</menuTree>
</veniceHelp>