Note that there are some explanatory texts on larger screens.

plurals
  1. POActionscript 3 find what item in xml contains selected label and return another label from the same node
    primarykey
    data
    text
    <p>I have an XML that i retrieve from a call so all values are dynamic exept for the labels of the nodes(so I know that there is a appname that I have to display). I display appname in a ComboBox, then I need to get another value from another label in the same node, my xml has structure like so </p> <pre><code>&lt;root&gt; &lt;item&gt; &lt;name&gt;Hello&lt;/name&gt; &lt;version&gt;World&lt;/version&gt; &lt;/item&gt; &lt;item&gt; &lt;name&gt;See_you&lt;/name&gt; &lt;version&gt;soon&lt;/version&gt; &lt;/item&gt; &lt;/root&gt; </code></pre> <p>Now, I have a flex mx:ComboBox that has dynamic values, the user selects the label , for example Hello, and I need to find the corresponding node value, and the child value, so i can return World. </p> <p>I can define the labels of the ComboBox via dataProvider, so it's done. Now I cannot get the selected value via trace(event.currentTarget.selectedItem.@label); (I have on change handler on the ComboBox) = that's 1 problem;</p> <p>Second problem is how can I get a node value from an xml object if I have another node value in the same parent node( in this case)?</p> <p>I'm stuck on this and running out of time, please help. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ i have it like this in my mxml </p> <pre><code>&lt;mx:AddChild relativeTo="{VGroup}"&gt; &lt;mx:ComboBox id="AppListBox" change="AppListBox_changeHandler(Event.CHANGE)"/&gt; &lt;/mx:AddChild&gt; </code></pre> <p>then i provide data, when I have it in my script, like so</p> <pre><code>AppListBox.dataProvider = appxml.item.appname.text(); </code></pre> <p>appxml - is a that xml</p> <p>Then I try to get the value of selected item, i tried like that:</p> <pre><code>protected function AppListBox_changeHandler(event:Event):void { trace(event.currentTarget.selectedItem.label); trace(event.currentTarget.selectedItem.data); trace(event.currentTarget.selectedItem.@label); trace(AppListBox.selectedItem.label); trace(AppListBox.selectedItem.@label); trace(AppListBox.selectedItem.name); </code></pre> <p>it does not display anything. not even error</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload