<?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>Abdul Qabiz on Web Technologies, Flash Platform, RIA, India &#187; querystring</title>
	<atom:link href="http://www.abdulqabiz.com/blog/archives/tag/querystring/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abdulqabiz.com/blog</link>
	<description>a developer and entrepreneur on web technologies, adobe flash platform (flex, flash, air), web, opensource, linux, free software, usability, startups, India...</description>
	<lastBuildDate>Thu, 29 Jul 2010 14:53:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='www.abdulqabiz.com' port='80' path='/blog/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>How to get URL query-string variables within Flex application</title>
		<link>http://www.abdulqabiz.com/blog/archives/2006/03/06/how-to-get-url-query-string-variables-within-flex-application/</link>
		<comments>http://www.abdulqabiz.com/blog/archives/2006/03/06/how-to-get-url-query-string-variables-within-flex-application/#comments</comments>
		<pubDate>Mon, 06 Mar 2006 07:45:00 +0000</pubDate>
		<dc:creator>Abdul Qabiz</dc:creator>
				<category><![CDATA[Flash and Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Macromedia Flex]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashplatform]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[querystring]]></category>
		<category><![CDATA[runtime]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://www.abdulqabiz.com/wordpress/?p=170</guid>
		<description><![CDATA[
			
				
			
		
On flexcoders, someone asked, how to get the URL parameters in a Flex 2.0 application? By URL parameter, I mean the query-string variables, as shown below:
http://yourserver/yourapp.swf?name=Joe&#38;age=22 or http://yourserver/yourapp.mxml?name=Joe&#38;age=22
Note: To get the variables in flex via mxml file, you need server-side compilation of mxml files.
You can get the values of the params using from   [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.abdulqabiz.com%2Fblog%2Farchives%2F2006%2F03%2F06%2Fhow-to-get-url-query-string-variables-within-flex-application%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.abdulqabiz.com%2Fblog%2Farchives%2F2006%2F03%2F06%2Fhow-to-get-url-query-string-variables-within-flex-application%2F&amp;source=abdulqabiz&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>On <a href="http://groups.yahoo.com/group/flexcoders/">flexcoders</a>, someone <a href="http://www.mail-archive.com/flexcoders%40yahoogroups.com/msg21892.html">asked</a>, how to get the URL parameters in a Flex 2.0 application? By URL parameter, I mean the query-string variables, as shown below:</p>
<p>http://yourserver/yourapp.swf?name=Joe&amp;age=22 or http://yourserver/yourapp.mxml?name=Joe&amp;age=22</p>
<p>Note: To get the variables in flex via mxml file, you need server-side compilation of mxml files.</p>
<p>You can get the values of the params using from  <code> </code></p>
<p><code></p>
<pre>mx.core.Application.application.parameters</pre>
<p></code></p>
<p>object, which contains the name-value pairs (hash-map).</p>
<p>For example, <code> </code></p>
<p><code></p>
<pre>mx.core.Application.application.parameters.name</pre>
<p></code></p>
<p>would return &#8220;Joe&#8221;, considering above example URL. You can find more information about this in livedocs: <a href="http://livedocs.macromedia.com/flex/20beta1/docs/00001300.html">http://livedocs.macromedia.com/flex/20beta1/docs/00001300.html</a></p>
<p>Then someone <a href="http://www.mail-archive.com/flexcoders%40yahoogroups.com/msg22086.html">asked</a>, what if your swf is embedded in custom html wrapper, how to get the query-string params inside swf?</p>
<p>Most of us use <a href="http://livedocs.macromedia.com/flash/8/main/00002200.html">ExternalInterface</a> class in Macromedia Flash Player 8(onwards) to invoke some JavaScript functions and extract the value in ActionScript.</p>
<p>I wrote a quick-and-dirty class in ActionScript 3, which would get the values of params from URL query-string for you. You don&#8217;t need any extra JavaScript code in HTML.  The same logic can be used for any an ActionScript 2.0 running Macromedia Flash Player 8.<br />
QueryString class has following properties:-</p>
<ul>
<li><code>parameters</code> &#8211; an Object which contains the name-value pairs from query-string</li>
<li><code>queryString</code>- String, this contains the entire query-string (url-encoded) name-value pairs.</li>
<li><code>url</code>- String, this returns the complete URL of the wrapper page with query-string.</li>
</ul>
<p><a href="http://www.abdulqabiz.com/files/test/QueryStringSample.html?myName=Abdul&amp;myHomeTown=Bangalore">See demo</a><br />
<a href="http://www.abdulqabiz.com/files/QueryStringSample.zip">Download source files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abdulqabiz.com/blog/archives/2006/03/06/how-to-get-url-query-string-variables-within-flex-application/feed/</wfw:commentRss>
		<slash:comments>82</slash:comments>
		</item>
	</channel>
</rss>
