RE: [flexcoders] newbie question - HTTP servive
In Flex 2, you need to use 'event.lastResult' - Cathy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robin BurrerSent: Thursday, August 17, 2006 9:59 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] newbie question - HTTP servive Hi there, I started playing around with the HTTP service. However I cant figure out how to access the actual result (in my case an xml string) If I set up a listener it just returns me an object in the onResult event. Why cant I access my xml string through event.result? How do I access it? public function onResult(event:ResultEvent):void { // why doesnt this work? trace (event.result.toString()); // this works but its very ugly //trace(event.message.body.toString()); } Thanks Robin // the code of my sample application ?xml version="1.0"? !-- Simple example to demonstrate the HTTPService tag. -- mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="go();" mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; public function go():void { feedRequest.addEventListener(ResultEvent.RESULT,onResult); feedRequest.send(); } public function onResult(event:ResultEvent):void { trace (event.result.toString()); //trace(event.message.body.toString()); } ]] /mx:Script mx:HTTPService id="feedRequest" url="" useProxy="false" / /mx:Application __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company 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. __,_._,___
RE: [flexcoders] newbie question - HTTP servive
lastResult is only for binding expressions. You still use event.result in a handler function. What is the resultFormat of the HTTPService? If it is object, toString() might not give you anything useful. For that matter, when you say doesnt work, exactly what do you mean? Tracy From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Cathy Reilly Sent: Friday, August 18, 2006 10:38 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] newbie question - HTTP servive In Flex 2, you need to use 'event.lastResult' - Cathy From: [EMAIL PROTECTED]ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Robin Burrer Sent: Thursday, August 17, 2006 9:59 PM To: [EMAIL PROTECTED]ups.com Subject: [flexcoders] newbie question - HTTP servive Hi there, I started playing around with the HTTP service. However I cant figure out how to access the actual result (in my case an xml string) If I set up a listener it just returns me an object in the onResult event. Why cant I access my xml string through event.result? How do I access it? public function onResult(event:ResultEvent):void { // why doesnt this work? trace (event.result.toString()); // this works but its very ugly //trace(event.message.body.toString()); } Thanks Robin // the code of my sample application ?xml version=1.0? !-- Simple example to demonstrate the HTTPService tag. -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml creationComplete=go(); mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; public function go():void { feedRequest.addEventListener(ResultEvent.RESULT,onResult); feedRequest.send(); } public function onResult(event:ResultEvent):void { trace (event.result.toString()); //trace(event.message.body.toString()); } ]] /mx:Script mx:HTTPService id=feedRequest url="">weblogs.macromedia.com/mchotin/index.xml useProxy=false / /mx:Application __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company 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] newbie question - HTTP servive
Hi there, I started playing around with the HTTP service. However I cant figure out how to access the actual result (in my case an xml string) If I set up a listener it just returns me an object in the onResult event. Why cant I access my xml string through event.result? How do I access it? public function onResult(event:ResultEvent):void { // why doesnt this work? trace (event.result.toString()); // this works but its very ugly //trace(event.message.body.toString()); } Thanks Robin // the code of my sample application ?xml version=1.0? !-- Simple example to demonstrate the HTTPService tag. -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml creationComplete=go(); mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; public function go():void { feedRequest.addEventListener(ResultEvent.RESULT,onResult); feedRequest.send(); } public function onResult(event:ResultEvent):void { trace (event.result.toString()); //trace(event.message.body.toString()); } ]] /mx:Script mx:HTTPService id=feedRequest url="" useProxy=false / /mx:Application __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company 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. __,_._,___