ok I got it. I just had trouble with the addEventListener syntax.
 
 
    xmlServ = new HTTPService();
    xmlServ.url = "";
    xmlServ.addEventListener("result", httpResult);
    xmlServ.addEventListener("fault", httpFault);
    xmlServ.resultFormat = "e4x";
    xmlServ.send();
 
   private function httpResult(event:ResultEvent):void
            {    
    Alert.show("onResult returned something");
            }
                       
            private function httpFault(event:FaultEvent):void
            {
          var faultstring:String = event.fault.faultstring;
          Alert.show(faultstring);
      }
 
 
Stefan
 
 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Richter
Sent: 31 March 2006 09:23
To: [email protected]
Subject: RE: [flexcoders] HTTPService in AS class

I think my problem is the syntax for setting up the listener. How would I catch the the result event with in a method 'myResult'?
 
Thanks
 
Stefan
 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Chambers
Sent: 30 March 2006 22:16
To: [email protected]
Subject: Re: [flexcoders] HTTPService in AS class

What are you having a problem with. You can just instantiate it via
ActionScript, set the appropriate properties, and listen for the result
event.

Make sure you are importing the correct class though:

mx.rpc.http.HTTPService

mike chambers

[EMAIL PROTECTED]

Stefan Richter wrote:
> I know this sounds silly but could someone show me how I use httpservice
> in AS? I don't want to use the mxml tag. It's just for practice and I
> can't get it to work for some reason. I am using an e4x resultFormat and
> can create and send ok - or so it seems. I am having trouble grasping
> how to get hold of the returned data.

> I got it working fine with mxml.

> Thanks

> Stefan

>
>
> --
> 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
> <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
>       Computer software development
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
>       Software design and development
> <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
>
> Macromedia flex
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw>
>       Software development best practice
> <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "flexcoders
>       <http://groups.yahoo.com/group/flexcoders>" on the web.
>       
>     *  To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
>       <mailto:[EMAIL PROTECTED]>
>       
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>


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




Reply via email to