Peace, Mike
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="SampleFunction(event)"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.http.mxml.HTTPService;
private function SampleFunction(event:Event):void
{
var http:HTTPService;
http = new HTTPService();
http.url = "" href="http://www.domain.com/my_xml.php">http://www.domain.com/my_xml.php";
http.method="POST";
http.useProxy = false;
http.showBusyCursor = true;
http.resultFormat = "xml";
http.addEventListener(ResultEvent.RESULT, xmlReceived);
http.send();
}
private function xmlReceived(event:ResultEvent):void
{
var myXML:String;
myXML = event.result as XML;
trace(myXML);
// Do something with the XML
}
]]>
</mx:Script>
</mx:Application>
On 6/17/06, NZEYIMANA Emery Fabrice <[EMAIL PROTECTED]> wrote:
Thank you very much.
I imported the class and it now works.
Thanks to you Geoffrey and Martine for the help.
Emery
--- In [email protected], "Geoffrey Williams" <[EMAIL PROTECTED]> wrote:
>
> Are you importing the class?
>
> import mx.rpc.events.ResultEvent;
>
> --- In [email protected], "NZEYIMANA Emery Fabrice"
> <nzeyimana@> wrote:
> >
> > Thanks Martine,
> > I have read from the manuals and tried to do the following:
> >
> > private function SampleFunction():void
> > {
> > var http:HTTPService;
> >
> > http = new HTTPService();
> > http.url = "" href="http://www.domain.com/my_xml.php" target="_blank" >http://www.domain.com/my_xml.php";
> > http.method="POST";
> > http.useProxy = false;
> > http.showBusyCursor = true;
> > http.resultFormat = "text";
> >
> >
> > http.addEventListener( "result", xmlReceived );
> > http.send();
> > }
> >
> >
> > private function xmlReceived(event:ResultEvent):void
> > {
> > var myXML:String;
> > myXML = event.toString();
> >
> > // Do something with the XML
> > }
> >
> >
> > The application cannot compile because it says that the
> ResultEvent Type cannot be found.
> > I even tried to private function xmlReceived
> (event:mx.rpc.events.ResultEvent):void but it doesn't solve the
> problem.
> > The error message I receive is "Type was not found or was not a
> compile-time constant: ResultEvent."
>
--
What goes up, does come down. __._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
- [flexcoders] Re: Using HTTPService in a function Geoffrey Williams
- [flexcoders] Re: Using HTTPService in a funct... NZEYIMANA Emery Fabrice
- Re: [flexcoders] Re: Using HTTPService in... Michael Schmalle
- [flexcoders] Re: Using HTTPService in... NZEYIMANA Emery Fabrice
Reply via email to

