<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; lastResult</title>
	<atom:link href="http://blog.flexexamples.com/tag/lastresult/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using HTTPService tag to send/receive variables to a server-side script</title>
		<link>http://blog.flexexamples.com/2007/08/16/using-httpservice-tag-to-sendreceive-variables-to-a-server-side-script/</link>
		<comments>http://blog.flexexamples.com/2007/08/16/using-httpservice-tag-to-sendreceive-variables-to-a-server-side-script/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 21:28:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[FlashVars]]></category>
		<category><![CDATA[HTTPService]]></category>
		<category><![CDATA[lastResult]]></category>
		<category><![CDATA[send()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/16/using-httpservice-tag-to-sendreceive-variables-to-a-server-side-script/</guid>
		<description><![CDATA[<p>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/&#8221;Hello world&#8221; type script, but it accepts URL or FORM variables, so you can send using the GET or [...]]]></description>
			<content:encoded><![CDATA[<p>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/&#8221;Hello world&#8221; type script, but it accepts URL or FORM variables, so you can send using the GET or POST HTTP-method.</p>
<p>It&#8217;s a pretty basic/crude example, but maybe it helps somebody out there.</p>
<p>Full code after the jump.</p>
<p><span id="more-94"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HTTPService_post_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/16/using-httpservice-tag-to-sendreceive-variables-to-a-server-side-script/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        creationComplete="httpService.send(myObj);"&gt;

    &lt;!-- Parameters to send to remote script. --&gt;
    &lt;mx:Object id="myObj" name="peterd" /&gt;

    &lt;mx:HTTPService id="httpService"
            url="http://www.flash-mx.com/mm/greeting.cfm"
            method="POST"
            resultFormat="flashvars" /&gt;

    &lt;mx:Label text="{httpService.lastResult.welcomeMessage}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HTTPService_post_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/HTTPService_post_test/bin/main.html" width="100%" height="100"></iframe></p>
<p class="new">By popular request, here is the ColdFusion source code as well.</p>
<p class="download">http://www.flash-mx.com/mm/greeting.cfm</p>
<pre class="code">
&lt;cfsilent&gt;
&lt;cfsetting enablecfoutputonly=&quot;Yes&quot;&gt;
&lt;cfif IsDefined(&quot;URL.name&quot;)&gt;&lt;cfset Form.Name = URL.name /&gt;&lt;/cfif&gt;
&lt;cfif NOT IsDefined(&quot;Form.name&quot;) OR Len(Trim(Form.Name)) EQ 0&gt;
    &lt;cfset Form.Name = &quot;[Mysterious Stranger]&quot; /&gt;
&lt;/cfif&gt;
&lt;/cfsilent&gt;&lt;cfcontent reset=&quot;true&quot; /&gt;&lt;cfoutput&gt;welcomeMessage=#UrlEncodedFormat(&quot;Welcome, &quot;&#038;Form.name)#&lt;/cfoutput&gt;
&lt;cfsetting enablecfoutputonly=&quot;No&quot;&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using HTTPService tag to send/receive variables to a server-side script on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/16/using-httpservice-tag-to-sendreceive-variables-to-a-server-side-script/',contentID: 'post-94',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'lastResult,send()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/16/using-httpservice-tag-to-sendreceive-variables-to-a-server-side-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

