Theory looks good.

 

Have you debugged to see if  httpResult is being called?

 

One problem, you are not seetting resultFormat="e4x" in the component
code, so the line, xmlFeed = event.result as XML; certainly will fail.

 

But step into or put a trace in httpResult first.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of john fisher
Sent: Friday, November 21, 2008 3:42 PM
To: [email protected]
Subject: Re: [flexcoders] multiple data sources not loading except in
MXMLapp

 

great. good news = " I am doing something wrong"
never mind Flare - the data is never getting there...

here's what I have:
an xml source and a graphml source. Each will drive a visualization.
Maybe more sources to come...

here's what I want to do:
make a class or component for each type of visualization, and pull the
data in inside the class.

so far:
when I make a component and try to use HTTPService or URLloader I get no
data.
when I tried two httpservice tags in the MXMLapp, I get data from only
one, I assume because the "event" never fires in one... But I'd rather
call HTTPService from inside the component anyway.

#####################################
this works in the mxmlapp:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
layout="absolute" xmlns:ns1="flare.flex.*" xmlns:demo="com.flare.*"
xmlns:local="*" applicationComplete="rawData.send()" >
<mx:HTTPService url=
"http://john.znyx.com/oaflowdemo/mygraphml_realdata2.xml
<http://john.znyx.com/oaflowdemo/mygraphml_realdata2.xml> "
id="rawData" resultFormat="e4x"
result="gmrResultHandler(event);" fault="gmrFaultHandler(event);"
/> 
....
[Bindable]
public var gmrFeed:XML;
private function gmrResultHandler(event:ResultEvent):void
{
gmrFeed = event.result as XML;
}

#######################################
this doesn't work in the component:
[Bindable]
private var xmlFeed:XML;
private function useHttpService():void {
service = new HTTPService();
//service.destination =
service.method = "POST";
service.addEventListener("result", httpResult);
service.addEventListener("fault", httpFault);
service.url="http://john.com/oaflowdemo/mygraphml.xml
<http://john.com/oaflowdemo/mygraphml.xml> ";
service.send();
}

private function httpResult(event:ResultEvent):void
{ 
xmlFeed = event.result as XML; 
}

Tracy Spratt wrote:
> Why do you want two? You can, but do you really need to?
>
> Tracy
>
> 

 

Reply via email to