开发者

Flex4 finding the name of the selected XML item

开发者 https://www.devze.com 2023-02-09 22:46 出处:网络
I have an XML object in Flex4 that is populating a tree (amongst other things). I need to be able to find the name of the selected item when it is clicked in the tree.

I have an XML object in Flex4 that is populating a tree (amongst other things).

I need to be able to find the name of the selected item when it is clicked in the tree.

For example:

<Object id="">
<Image></Image>
<Cycle></Cycle>
</Object>
<Action>
<Hide></Hide>
</Act开发者_StackOverflow社区ion>

The tags are all predefnied by me so I will know what they are, but I need to be able to know if the item a user has selected is "Object" and do something, or if they select "Action" do something else.

What is the syntax to get the names of these in flex4 and compare them?

Thanks


If you have a reference to the XML node, you can call the name() method:

var xml:XML = <data><myNode/></data>;
trace(xml.child(0).name()); //traces "myNode"
0

精彩评论

暂无评论...
验证码 换一张
取 消