try to set your tree's showRoot="false"

usually when dealing with xml you have to do that.

--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> First, to get the result event, do not use lastResult.  That is intended
> for binding expressions only.  Instead do:
> 
> myXML = XML(event.result);
> 
> trace(myXML.toXMLString())
> 
> THEN use e4x xml methods and properties to get the node you want for the
> root of your tree.  See the docs, childNodes is not an XML property.
> 
>  
> 
> Tracy
> 
>  
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Misael Ferreira
> Sent: Wednesday, January 03, 2007 5:59 PM
> To: [email protected]
> Subject: [flexcoders] Populate tree from specific XML Node
> 
>  
> 
> Hi,
> 
> I want to populate a tree from a specific node from a XML obtained via
> HTTPService. I have the following:
> 
>               [Bindable]
>               public var myXML:XML;        
>               
>       
>       <mx:script>
>               private function onResult(oEvent:ResultEvent):void { 
>                   myXML =  reqProblemas.lastResult.childNodes[2];
>               }
>       </mx:script>
>       
>       <mx:HTTPService id="reqProblemas" url="problemas/problemas.xml"
> resultFormat="xml"  result="onResult(event)"  makeObjectsBindable="true"
> useProxy="false"  showBusyCursor="true" /> 
>       
>       <mx:Tree x="10" y="140" width="505" dataProvider="{treeProb}"
> id="treeProblema"></mx:Tree> 
> 
> But this isnt working, the tree is populated with raw XML data, instead
> of the tree branches beginning from the third node, that is NODES:
> 
> <?xml version="1.0" encoding="utf-8" ?><tree id="tree">
> <options>
>   <opt name="target" value="_self"></opt>
> </options>
> <icons> 
>   <ico name="pnb"
> value="http://localhost/marquise/componentes/js/tree/plusnb.gif
> <http://localhost/marquise/componentes/js/tree/plusnb.gif> "></ico>
> </icons>
> <nodes id="0" caption="Categorias" url="" ic="" exp="true" chk="false"
> cststyle="" target="null" title="Categorias"> 
>   <node id="806" caption="Aplicativos" url="" ic="" exp="false"
> chk="false" cststyle="" target="null" title="Aplicativos"> 
>     <node id="808" caption="Office" url="" ic="" exp="false" chk="false"
> cststyle="" target="null" title="Office">
>       <node id="809" caption="Excel" url="" ic="" exp="false"
> chk="false" cststyle="" target="null" title="Excel"> 
>       </node>
>       <node id="810" caption="PowerPoint" url="" ic="" exp="false"
> chk="false" cststyle="" target="null" title="PowerPoint"> 
>       </node>
>       <node id="811" caption="Word" url="" ic="" exp="false" chk="false"
> cststyle="" target="null" title="Word"> 
>       </node>
>     </node>
>     <node id="807" caption="Windows" url="" ic="" exp="false"
> chk="false" cststyle="" target="null" title="Windows"> 
>     </node>
>   </node>
> </nodes>
> </tree>
>


Reply via email to