<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Access the Query-String Variables from Flex Application</title>
	<atom:link href="http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/</link>
	<description>flex developers web corner</description>
	<pubDate>Fri, 21 Nov 2008 19:10:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: Cristobal Dabed</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-841</link>
		<dc:creator>Cristobal Dabed</dc:creator>
		<pubDate>Wed, 15 Oct 2008 14:32:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-841</guid>
		<description>One can use URLVariables Class and a simple regexp to parse the query params into an object.
&lt;code&gt;
var url:String = "http://example.com/?param1=test&#38;param2=sample";
var variables:URLVariables = new URLVariables(url.replace(/.+&#92;?/, ""));
for (var key:* in variables){
&#160;&#160;&#160;&#160;trace(key + "=" + variables[key]);
}
&lt;/code&gt;
Gives us the following output:
&lt;code&gt;
param1 = test
param2 = sample
&lt;/code&gt;
Or just access the query params directly trough the variables object if one knows the param name
&lt;code&gt;
var param1:String = variables["param1"];
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>One can use URLVariables Class and a simple regexp to parse the query params into an object.<br />
<code><br />
var url:String = "http://example.com/?param1=test&amp;param2=sample";<br />
var variables:URLVariables = new URLVariables(url.replace(/.+&#92;?/, ""));<br />
for (var key:* in variables){<br />
&nbsp;&nbsp;&nbsp;&nbsp;trace(key + "=" + variables[key]);<br />
}<br />
</code><br />
Gives us the following output:<br />
<code><br />
param1 = test<br />
param2 = sample<br />
</code><br />
Or just access the query params directly trough the variables object if one knows the param name<br />
<code><br />
var param1:String = variables["param1"];<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ben orchard</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-832</link>
		<dc:creator>ben orchard</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:35:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-832</guid>
		<description>hmm...everything looks good, but I simply cannot get this to import the bloody parameters...I've tried everything I can think of...and when I simply use the queries as you designate, the flash just can't pick up my parameters--whether I pass them via an embedded html wrapped link OR directly to the swf.  Both ways it refuses to see the information.  Any suggestions?</description>
		<content:encoded><![CDATA[<p>hmm&#8230;everything looks good, but I simply cannot get this to import the bloody parameters&#8230;I&#8217;ve tried everything I can think of&#8230;and when I simply use the queries as you designate, the flash just can&#8217;t pick up my parameters&#8211;whether I pass them via an embedded html wrapped link OR directly to the swf.  Both ways it refuses to see the information.  Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Caspar</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-221</link>
		<dc:creator>Caspar</dc:creator>
		<pubDate>Tue, 20 May 2008 00:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-221</guid>
		<description>&lt;code&gt;
private function combineParams():void
{
&#160;&#160;&#160;&#160;/*
&#160;&#160;&#160;&#160;* Remove the duplicates from url because the params from 
&#160;&#160;&#160;&#160;* SWF Object has priority
&#160;&#160;&#160;&#160;* Put the new associative array in the newParamsFromUrl
&#160;&#160;&#160;&#160;*/
&#160;&#160;&#160;&#160;var newParamsFromUrl:Object = new Object();
&#160;&#160;&#160;&#160;for (var tmpC1:* in _paramsFromUrl)
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for (var tmpC2:* in _paramsFromSwfObject)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(tmpC1 == tmpC2)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// do nothing - pass over to eliminate the duplicate
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} else {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//added - if swf url was not defined, no url parameters were defined
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if ( tmpC2 == undefined ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;...
&#160;&#160;&#160;&#160;...
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code><br />
private function combineParams():void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;/*<br />
&nbsp;&nbsp;&nbsp;&nbsp;* Remove the duplicates from url because the params from<br />
&nbsp;&nbsp;&nbsp;&nbsp;* SWF Object has priority<br />
&nbsp;&nbsp;&nbsp;&nbsp;* Put the new associative array in the newParamsFromUrl<br />
&nbsp;&nbsp;&nbsp;&nbsp;*/<br />
&nbsp;&nbsp;&nbsp;&nbsp;var newParamsFromUrl:Object = new Object();<br />
&nbsp;&nbsp;&nbsp;&nbsp;for (var tmpC1:* in _paramsFromUrl)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (var tmpC2:* in _paramsFromSwfObject)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(tmpC1 == tmpC2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// do nothing - pass over to eliminate the duplicate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//added - if swf url was not defined, no url parameters were defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( tmpC2 == undefined ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8230;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8230;<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Caspar</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-220</link>
		<dc:creator>Caspar</dc:creator>
		<pubDate>Tue, 20 May 2008 00:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-220</guid>
		<description>Hi Andrei,

Thanks for this  - you have created a lovely object.
Just one thing - I may have found a bug - either that or my implementation of the object is incorrect.
In the combineParams() function, I had to add a couple of extra lines to prevent the html params from being dropped. This happens if the swf params are "undefined" ie not present. Here's what I added:
&lt;code&gt;
private function combineParams():void
{
&#160;&#160;&#160;&#160;/*
&#160;&#160;&#160;&#160;* Remove the duplicates from url because the params from 
&#160;&#160;&#160;&#160;* SWF Object has priority
&#160;&#160;&#160;&#160;* Put the new associative array in the newParamsFromUrl
&#160;&#160;&#160;&#160;*/
&#160;&#160;&#160;&#160;var newParamsFromUrl:Object = new Object();
&#160;&#160;&#160;&#160;for (var tmpC1:* in _paramsFromUrl)
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for (var tmpC2:* in _paramsFromSwfObject)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(tmpC1 == tmpC2)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// do nothing - pass over to eliminate the duplicate
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} else {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//added - if swf url was not defined, no url parameters were defined
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if ( tmpC2 == undefined ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;...
&#160;&#160;&#160;&#160;...
}</description>
		<content:encoded><![CDATA[<p>Hi Andrei,</p>
<p>Thanks for this  - you have created a lovely object.<br />
Just one thing - I may have found a bug - either that or my implementation of the object is incorrect.<br />
In the combineParams() function, I had to add a couple of extra lines to prevent the html params from being dropped. This happens if the swf params are &#8220;undefined&#8221; ie not present. Here&#8217;s what I added:<br />
<code><br />
private function combineParams():void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;/*<br />
&nbsp;&nbsp;&nbsp;&nbsp;* Remove the duplicates from url because the params from<br />
&nbsp;&nbsp;&nbsp;&nbsp;* SWF Object has priority<br />
&nbsp;&nbsp;&nbsp;&nbsp;* Put the new associative array in the newParamsFromUrl<br />
&nbsp;&nbsp;&nbsp;&nbsp;*/<br />
&nbsp;&nbsp;&nbsp;&nbsp;var newParamsFromUrl:Object = new Object();<br />
&nbsp;&nbsp;&nbsp;&nbsp;for (var tmpC1:* in _paramsFromUrl)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (var tmpC2:* in _paramsFromSwfObject)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(tmpC1 == tmpC2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// do nothing - pass over to eliminate the duplicate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//added - if swf url was not defined, no url parameters were defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( tmpC2 == undefined ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newParamsFromUrl[tmpC1] = _paramsFromUrl[tmpC1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8230;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8230;<br />
}</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damon</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-76</link>
		<dc:creator>Damon</dc:creator>
		<pubDate>Fri, 21 Mar 2008 18:08:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-76</guid>
		<description>Thanks Andrei for the solution, but I was unclear as to my goal...
I'm trying to achieve:
&lt;code&gt;var arr:Array = new Array(  { uniqueid:"01", mm_name:"cat.jpg", mm_path:"img/req1", mm_keywords:"cat, black cat" },
                            { uniqueid:"02", mm_name:"dog.jpg", mm_path:"img/req2", mm_keywords:"dog, brown dog" },
                            { uniqueid:"03", mm_name:"elephant.jpg", mm_path:"img/req36", mm_keywords:"elephant, large elephant" }
                            );
arr.forEach(traceContinent);
function traceContinent(element:*, index:int, arr:Array):void {
    trace(element.mm_path + "/" + element.mm_name + "keywords=" + element.mm_keywords);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks Andrei for the solution, but I was unclear as to my goal&#8230;<br />
I&#8217;m trying to achieve:<br />
<code>var arr:Array = new Array(  { uniqueid:"01", mm_name:"cat.jpg", mm_path:"img/req1", mm_keywords:"cat, black cat" },<br />
                            { uniqueid:"02", mm_name:"dog.jpg", mm_path:"img/req2", mm_keywords:"dog, brown dog" },<br />
                            { uniqueid:"03", mm_name:"elephant.jpg", mm_path:"img/req36", mm_keywords:"elephant, large elephant" }<br />
                            );<br />
arr.forEach(traceContinent);<br />
function traceContinent(element:*, index:int, arr:Array):void {<br />
    trace(element.mm_path + "/" + element.mm_name + "keywords=" + element.mm_keywords);<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-65</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Thu, 20 Mar 2008 00:52:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-65</guid>
		<description>First of all, the string you provided is not a well formed URL so putting it in the browser URL may provide unexpected behaviour, second the following function is in response to what I manage to understand from your comment/request and third is more related to parsing than query strings as you could use other URL formating to get rid of all code I had to write.
&lt;code&gt;
public function parseYourWay(str:String):Array
{
&#160;&#160;&#160;&#160;// remove un-needed array(0)0 thing
&#160;&#160;&#160;&#160;var removeArray:RegExp = /\&#038;?array\(\d+\)\d+/g;
&#160;&#160;&#160;&#160;// find pairs
&#160;&#160;&#160;&#160;var findPairs:RegExp = /([^,]+)=([^,]+)/g;
&#160;&#160;&#160;&#160;// here pairs will be stored
&#160;&#160;&#160;&#160;var pairs:Array = new Array();
&#160;&#160;&#160;&#160;// here the whole string parsed will be as array
&#160;&#160;&#160;&#160;// structure: 
&#160;&#160;&#160;&#160;// &#160;&#160;&#160;&#160;foundValue[&lt;var_name&gt;] = [&lt;value1&gt;,&lt;value2&gt;,...]
&#160;&#160;&#160;&#160;// example (this is what the function returns):
&#160;&#160;&#160;&#160;// &#160;&#160;&#160;&#160;foundValue['mm_keywords'] = ["keyword1","map satellite","robot black and white"];
&#160;&#160;&#160;&#160;// &#160;&#160;&#160;&#160;foundValue['mm_name'] = ["bluehills.jpg","satelllite_map.jpg","robot.jpg"];
&#160;&#160;&#160;&#160;// &#160;&#160;&#160;&#160;foundValue['mm_path'] = ["img/req1","img/req2","img/req2"];
&#160;&#160;&#160;&#160;var foundValue:Array = new Array();&lt;/code&gt;
&lt;code&gt;
&#160;&#160;&#160;&#160;var tmpStr:String = str.replace(removeArray,"");
&#160;&#160;&#160;&#160;// finding pairs
&#160;&#160;&#160;&#160;pairs = tmpStr.match(findPairs);
&#160;&#160;&#160;&#160;for (var i:int = 0; i &lt; pairs.length; i++) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// reseting index for exec command
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;findPairs.lastIndex = 0;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// finding name and values in pairs
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var tmpF:Array = findPairs.exec(pairs[i]);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// new array only if not exists otherwise will be overwritten
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (!foundValue[tmpF[1]]) foundValue[tmpF[1]] = new Array();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// adding value found
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;foundValue[tmpF[1]].push(tmpF[2]);
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;return foundValue;
}
&lt;/code&gt;
&lt;br /&gt;
The function can be used as bellow:
&lt;code&gt;
var tmp:Array = parseYourWay("array(0)1,mm_name=bluehills.jpg,mm_path=img/req1,mm_keywords=keyword1&#038;arra....");
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>First of all, the string you provided is not a well formed URL so putting it in the browser URL may provide unexpected behaviour, second the following function is in response to what I manage to understand from your comment/request and third is more related to parsing than query strings as you could use other URL formating to get rid of all code I had to write.<br />
<code><br />
public function parseYourWay(str:String):Array<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;// remove un-needed array(0)0 thing<br />
&nbsp;&nbsp;&nbsp;&nbsp;var removeArray:RegExp = /\&#038;?array\(\d+\)\d+/g;<br />
&nbsp;&nbsp;&nbsp;&nbsp;// find pairs<br />
&nbsp;&nbsp;&nbsp;&nbsp;var findPairs:RegExp = /([^,]+)=([^,]+)/g;<br />
&nbsp;&nbsp;&nbsp;&nbsp;// here pairs will be stored<br />
&nbsp;&nbsp;&nbsp;&nbsp;var pairs:Array = new Array();<br />
&nbsp;&nbsp;&nbsp;&nbsp;// here the whole string parsed will be as array<br />
&nbsp;&nbsp;&nbsp;&nbsp;// structure:<br />
&nbsp;&nbsp;&nbsp;&nbsp;// &nbsp;&nbsp;&nbsp;&nbsp;foundValue[<var_name>] = [<value1>,<value2>,...]<br />
&nbsp;&nbsp;&nbsp;&nbsp;// example (this is what the function returns):<br />
&nbsp;&nbsp;&nbsp;&nbsp;// &nbsp;&nbsp;&nbsp;&nbsp;foundValue['mm_keywords'] = ["keyword1","map satellite","robot black and white"];<br />
&nbsp;&nbsp;&nbsp;&nbsp;// &nbsp;&nbsp;&nbsp;&nbsp;foundValue['mm_name'] = ["bluehills.jpg","satelllite_map.jpg","robot.jpg"];<br />
&nbsp;&nbsp;&nbsp;&nbsp;// &nbsp;&nbsp;&nbsp;&nbsp;foundValue['mm_path'] = ["img/req1","img/req2","img/req2"];<br />
&nbsp;&nbsp;&nbsp;&nbsp;var foundValue:Array = new Array();</value2></value1></var_name></code><br />
<code><br />
&nbsp;&nbsp;&nbsp;&nbsp;var tmpStr:String = str.replace(removeArray,"");<br />
&nbsp;&nbsp;&nbsp;&nbsp;// finding pairs<br />
&nbsp;&nbsp;&nbsp;&nbsp;pairs = tmpStr.match(findPairs);<br />
&nbsp;&nbsp;&nbsp;&nbsp;for (var i:int = 0; i < pairs.length; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// reseting index for exec command<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;findPairs.lastIndex = 0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// finding name and values in pairs<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var tmpF:Array = findPairs.exec(pairs[i]);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// new array only if not exists otherwise will be overwritten<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!foundValue[tmpF[1]]) foundValue[tmpF[1]] = new Array();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// adding value found<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foundValue[tmpF[1]].push(tmpF[2]);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;return foundValue;<br />
}<br />
</code><br />
<br />
The function can be used as bellow:<br />
</code><code><br />
var tmp:Array = parseYourWay("array(0)1,mm_name=bluehills.jpg,mm_path=img/req1,mm_keywords=keyword1&#038;arra....");<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: damon</title>
		<link>http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-63</link>
		<dc:creator>damon</dc:creator>
		<pubDate>Wed, 19 Mar 2008 18:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/11/28/access-the-query-string-variables-from-flex-application/#comment-63</guid>
		<description>this is very helpful, but I'm trying to parse a string that is being returned from an ASP script...looks like
array(0)1,mm_name=bluehills.jpg,mm_path=img/req1,mm_keywords=keyword1&#38;array(1)2,mm_name=satellite_map.jpg,mm_path=img/req2,mm_keywords=map satellite&#38;array(2)3,mm_name=robot.jpg,mm_path=img/req2,mm_keywords=robot black and white&#38;
my biggest problem is parsing the values into an array.  I'd like to create associative arrays that would hold individual values...

first array holds = mm_name=robot.jpg, mm_name=robot2.jpg,...

second array holds = mm_desc=Robot, mm_desc=Robot2,...
any suggestions are appreciated.</description>
		<content:encoded><![CDATA[<p>this is very helpful, but I&#8217;m trying to parse a string that is being returned from an ASP script&#8230;looks like<br />
array(0)1,mm_name=bluehills.jpg,mm_path=img/req1,mm_keywords=keyword1&amp;array(1)2,mm_name=satellite_map.jpg,mm_path=img/req2,mm_keywords=map satellite&amp;array(2)3,mm_name=robot.jpg,mm_path=img/req2,mm_keywords=robot black and white&amp;<br />
my biggest problem is parsing the values into an array.  I&#8217;d like to create associative arrays that would hold individual values&#8230;</p>
<p>first array holds = mm_name=robot.jpg, mm_name=robot2.jpg,&#8230;</p>
<p>second array holds = mm_desc=Robot, mm_desc=Robot2,&#8230;<br />
any suggestions are appreciated.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
