Using HTTPService tag to send/receive variables to a server-side script
The following example demonstrates a very simple usage of sending parameters from Flex to a server-side script (written in ColdFusion) and then displaying the server response in our Flex application. The server-side script is a simple echo/”Hello world” type script, but it accepts URL or FORM variables, so you can send using the GET or POST HTTP-method.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="httpService.send(myObj);"> <!-- Parameters to send to remote script. --> <mx:Object id="myObj" name="john" /> <mx:HTTPService id="httpService" url="http://www.flash-mx.com/mm/greeting.cfm" method="POST" resultFormat="flashvars" /> <mx:Label text="{httpService.lastResult.welcomeMessage}" /> </mx:Application> |
10:03 AM
|
Labels:
Flex HTTPService,
Flex Samples
|
This entry was posted on 10:03 AM
and is filed under
Flex HTTPService
,
Flex Samples
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment