Thanks Tracy.  With your help, I was able to conquer what I needed.  
I had to change the line of:

myXML = XML (oEvent.result.Root);
to 
myXML = XML (oEvent.result);

I've now got my runtime queried tree.

Thanks to all,
Aaron
--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
>
> For a tree, using the e4x xml directly is easiest, no need for an
> XMLListCollection:
> 
> [Bindable]
> public var myXML:XML;
> 
>  
> 
> I advise using a result handler:
> 
> <mx:HTTPService id="rstTree" url="http://Path/To/XML.aspx"; 
> useProxy="false" resultFormat="e4x" result="onResult(event)" />
> 
>  
> 
> Private function onResult(oEvent:ResultEvent):void {
> 
> myXML = XML (oEvent.result.Root);
> 
> trace(myXML.toXMLString);  //should produce valid looking xml
> 
> }
> 
>  
> 
> And dataProvider="{myXML}"
> 
>  
> 
> See if that does better for you.
> 
>  
> 
> Tracy
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of meathead
> Sent: Thursday, November 02, 2006 4:49 PM
> To: [email protected]
> Subject: [flexcoders] Re: Tree not updating with correct XML
> 
>  
> 
> Okay, I'm trying to figure this out. Things look just like the 
help 
> files, but I'm not working. Here's what I got so far....
> 
> HTTPService is this 
> ********************************
> <mx:HTTPService id="rstTree" url="http://Path/To/XML.aspx
> <http://Path/To/XML.aspx> " 
> useProxy="false" resultFormat="e4x" result="" />
> *******************************
> I've tried both e4x and xml as resultFormat.
> 
> Script code looks like this
> ********************************
> import mx.collections.*;
> [Bindable]
> public var myXLC:XMLListCollection;
> 
> public function init():void
> {
> myXLC = new XMLListCollection
> (rstTree.lastResult.Root);
> 
> }
> *********************************
> 
> I've got the init function being called at application 
> creationComplete.
> 
> Here's my tree MXML
> ********************************
> <mx:Tree id="tvwProjects" width="100%" height="100%" 
> dataProvider="{myXLC}" labelField="@label" 
itemClick="treeClickEvent
> (event);" y="10">
> </mx:Tree>
> ****************************************
> 
> Lastly, here is my xml from the aspx page.
> ******************************************
> <?xml version="1.0" encoding="utf-8" ?> 
> <Root label="Root" action="none">
> <menuitem label="2006" action="2006">
> <menuitem label="2006 07" action="2006 07">
> <menuitem label="Detail" action="Detail~2006 07" /> 
> <menuitem label="Rollup" action="Rollup~2006 07" /> 
> <menuitem label="Summary" action="Z Reports~2006 07" /> 
> </menuitem>
> <menuitem label="2006 08" action="2006 08">
> <menuitem label="Detail" action="Detail~2006 08" /> 
> <menuitem label="Rollup" action="Rollup~2006 08" /> 
> <menuitem label="Summary" action="Z Reports~2006 08" /> 
> </menuitem>
> <menuitem label="2006 09" action="2006 09">
> <menuitem label="Detail" action="Detail~2006 09" /> 
> <menuitem label="Rollup" action="Rollup~2006 09" /> 
> <menuitem label="Summary" action="Z Reports~2006 09" /> 
> </menuitem>
> </menuitem>
> </Root>
> **********************************
> I know that I'm returning my xml from the HTTPService since I can 
> show an alert box with data from it. However, Nothing is showing 
in 
> my tree. Nothing. 
> 
> Can anyone help?
> 
> Thanks,
> Aaron
> --- In [email protected] <mailto:flexcoders%
40yahoogroups.com>
> , "meathead" <makacos@> wrote:
> >
> > You pretty much answered my question when you stated that the 
XML 
> > tag gets set during compiled time. I was thinking I might have 
to 
> > use an HTTPService tag since the XML.aspx file will have 
different 
> > results depending on the time of day per user. Bummer we can't 
> just 
> > reset the XML tag. Thanks for the prompt reply. Off to go learn 
> > how to send in data to a tree via HTTPService.
> > 
> > Aaron
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com> , "Michael Labriola" 
<labriola@> 
> > wrote:
> > >
> > > 
> > > Aaron,
> > > 
> > > Need to clarify something:
> > > 
> > > When you say : The XML is changes, do you mean that the XML 
data
> > > retrieved from http://Path/To/XML.aspx 
<http://Path/To/XML.aspx>
> changes or that you 
> change 
> > the
> > > XMl after loading at the client?
> > > 
> > > I don't want to answer the wrong question, but the 
> > > mx:XML tag includes data at compile time, not runtime. So, the
> > > application is going to grab a copy of this data when it 
> compiles 
> > and
> > > build it in.
> > > 
> > > If you are looking to grab data at runtime, you need to look at
> > > something like an HTTP service tag to go and grab the data on 
> > command.
> > > 
> > > Let me know if this answers your question,
> > > --Mike
> > > 
> > > 
> > > 
> > > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com> , "meathead" <makacos@> 
wrote:
> > > >
> > > > Hi all,
> > > > 
> > > > I'm at a loss here. I've got a tree set up to retrieve XML 
> > data. 
> > > > It works fine until the data in the XML changes. Then the 
> tree 
> > > > won't reflect the new data until my flex application is 
> > recompiled. 
> > > > I believe when the application is being recomplied it's 
> grabbing 
> > the 
> > > > XML and setting it somehow. Here is some code. 
> > > > 
> > > > ****************CODE***************
> > > > <mx:Script>
> > > > <![CDATA[
> > > > import mx.events.ListEvent;
> > > > import mx.controls.Alert;
> > > > import mx.collections.*;
> > > > 
> > > > [Bindable]
> > > > public var myXLC:XMLListCollection;
> > > > 
> > > > public function afterComp():void
> > > > {
> > > > myXLC = new XMLListCollection(TreeXML.children());
> > > > tvwProjects.invalidateList();
> > > > }
> > > > ]]>
> > > > </mx:Script>
> > > > 
> > > > <mx:XML source="http://Path/To/XML.aspx 
<http://Path/To/XML.aspx>
> " id="TreeXML"/>
> > > > 
> > > > <mx:Tree id="tvwProjects" width="100%" height="100%" 
> > > > dataProvider="{myXLC}" labelField="@label" 
> > itemClick="treeClickEvent
> > > > (event);" y="10">
> > > > </mx:Tree>
> > > > ************END OF CODE*******************
> > > > I've also tried the above without the XMLListCollection and 
> just 
> > > > putting the TreeXML straight into the Tree object 
> dataProvider. 
> > The 
> > > > afterComp function is called in the application 
> createCompletion 
> > > > event. I've also tried with and without invalidateList. 
> > > > 
> > > > Basically, How can I get the Tree control to grab the latest 
> and 
> > > > greatest from the XML? 
> > > > 
> > > > Thanks,
> > > > Aaron
> > > >
> > >
> >
>





--
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