Sure Aaron,

Instead of loopin, have you tried something like this?

var myNode:XML = XML(myTree.selectedItem);

-TH

--- In [email protected], "aaron smith" 
<[EMAIL PROTECTED]> wrote:
>
> I am just trying a simple example with trying to parse some xml. I 
want to
> be able to find what node is selected according to what is 
selected in a
> Tree component.
> 
> here is my AS:
> 
> private function getSelectedNodeFromSelectedItem( searchXML:* ,
> selectedItem:Object ):XMLList
>         {
>             var foundNode:*;
> 
>             for each( var prop:* in searchXML )
>             {
> 
>                 if( [EMAIL PROTECTED] == [EMAIL PROTECTED] )
>                 {
>                     foundNode = XMLList( prop );
>                     break;
>                 }
> 
>                 else if( [EMAIL PROTECTED] == "folder" )
>                 {
>                     getSelectedNodeFromSelectedItem( prop.node );
>                 }
>             }
>             return foundNode;
>         }
> 
> 
> this is what the XML Looks like: (dataProvider to a Tree )
> 
> <node label='flash platform' id='1' type='folder' >
>    <node label='www.somelink.net' id='2' type='item' feedLocation='
> http://www.somelink.net' />
>    <node label=somelink' id='3' type='item' feedLocation='
> http://www.somelink.com' />
> </node>
> 
> 
> Say for instance you selected the 2nd child of the flash platform 
node. it
> would spit back:
> <node label=somelink' id='3' type='item' feedLocation='
> http://www.somelink.com' />
> 
> Say for instance you selected the root node which is a folder. it 
would spit
> back:
> <node label='flash platform' id='1' type='folder' >
>    <node label='www.smithaaronlee.net' id='2' type='item' 
feedLocation='
> http://www.smithaaronlee.net' />
>    <node label='teguh mualim' id='3' type='item' feedLocation='
> http://www.capcai.com' />
> </node>
> 
> 
> It seems to be working correctly to the point where it knows that 
the right
> node is selected, but then the return value is of type [object]. I 
can't
> figure out how to get it back as a string..
> 
> From the results that are spit back from that method I will pass 
that value
> to another parsing method to just grab all the individual items 
(type=item)
> in the selected node. See what I'm going for?
> 
> Maybe I need to cast the xml into an ArrayCollection?
> 
> thanks
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to