<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: generate random Strings in AS2 or AS3</title>
	<atom:link href="http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Sat, 04 Feb 2012 08:16:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Carlos Zambrano</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-8668</link>
		<dc:creator>Carlos Zambrano</dc:creator>
		<pubDate>Tue, 22 Nov 2011 00:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-8668</guid>
		<description>Great, but i dont know how to use it? how can made it working in a fla
Tahnks</description>
		<content:encoded><![CDATA[<p>Great, but i dont know how to use it? how can made it working in a fla<br />
Tahnks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JennyArt</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-8221</link>
		<dc:creator>JennyArt</dc:creator>
		<pubDate>Thu, 22 Sep 2011 17:28:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-8221</guid>
		<description>Thanks, I need this to improve my AS3 skill.</description>
		<content:encoded><![CDATA[<p>Thanks, I need this to improve my AS3 skill.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sasha Dzeletovic</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-6226</link>
		<dc:creator>Sasha Dzeletovic</dc:creator>
		<pubDate>Thu, 10 Mar 2011 02:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-6226</guid>
		<description>Thanks for the Class, nice of you to share.</description>
		<content:encoded><![CDATA[<p>Thanks for the Class, nice of you to share.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cdawg</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-6170</link>
		<dc:creator>Cdawg</dc:creator>
		<pubDate>Thu, 03 Mar 2011 12:21:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-6170</guid>
		<description>Added a little functionality to specify numbers or letters only. 

function gRS(newLength:uint = 1, userAlphabet:String = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;):String{
      if(userAlphabet == &#039;#&#039;){
		  userAlphabet=&quot;0123456789&quot;;
		  }
	  else if (userAlphabet == &#039;!#&#039;){  userAlphabet=&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;
		  }
	  var alphabet:Array = userAlphabet.split(&quot;&quot;);
      var alphabetLength:int = alphabet.length;
      var randomLetters:String = &quot;&quot;;
      for (var i:uint = 0; i &lt; newLength; i++){
        randomLetters += alphabet[int(Math.floor(Math.random() * alphabetLength))];
      }
      return randomLetters;
    }
trace(gRS(150));
trace(gRS(150, &quot;#&quot;));
trace(gRS(150, &quot;!#&quot;));</description>
		<content:encoded><![CDATA[<p>Added a little functionality to specify numbers or letters only. </p>
<p>function gRS(newLength:uint = 1, userAlphabet:String = &#8220;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&#8243;):String{<br />
      if(userAlphabet == &#8216;#&#8217;){<br />
		  userAlphabet=&#8221;0123456789&#8243;;<br />
		  }<br />
	  else if (userAlphabet == &#8216;!#&#8217;){  userAlphabet=&#8221;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#8221;;<br />
		  }<br />
	  var alphabet:Array = userAlphabet.split(&#8220;&#8221;);<br />
      var alphabetLength:int = alphabet.length;<br />
      var randomLetters:String = &#8220;&#8221;;<br />
      for (var i:uint = 0; i &lt; newLength; i++){<br />
        randomLetters += alphabet[int(Math.floor(Math.random() * alphabetLength))];<br />
      }<br />
      return randomLetters;<br />
    }<br />
trace(gRS(150));<br />
trace(gRS(150, &quot;#&quot;));<br />
trace(gRS(150, &quot;!#&quot;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Horoskop Waga</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-5408</link>
		<dc:creator>Horoskop Waga</dc:creator>
		<pubDate>Tue, 07 Sep 2010 00:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-5408</guid>
		<description>Good info</description>
		<content:encoded><![CDATA[<p>Good info</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gg</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-5355</link>
		<dc:creator>gg</dc:creator>
		<pubDate>Fri, 06 Aug 2010 07:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-5355</guid>
		<description>sorry i&#039;m a very new flash user.

on as2, do i create a dynamic textbox and name it randomLetter?

on as3 where can i find the library for 
import net.zedia.utils.StringUtils; ?

thanks</description>
		<content:encoded><![CDATA[<p>sorry i&#8217;m a very new flash user.</p>
<p>on as2, do i create a dynamic textbox and name it randomLetter?</p>
<p>on as3 where can i find the library for<br />
import net.zedia.utils.StringUtils; ?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reny Mohan</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-5326</link>
		<dc:creator>Reny Mohan</dc:creator>
		<pubDate>Tue, 27 Jul 2010 05:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-5326</guid>
		<description>Thanks alot..saved my time..</description>
		<content:encoded><![CDATA[<p>Thanks alot..saved my time..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonny</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-5122</link>
		<dc:creator>Jonny</dc:creator>
		<pubDate>Sat, 15 May 2010 11:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-5122</guid>
		<description>Many thanks from Birmingham, England; this has saved me some time :o)</description>
		<content:encoded><![CDATA[<p>Many thanks from Birmingham, England; this has saved me some time <img src='http://www.zedia.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vkwave</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-4996</link>
		<dc:creator>vkwave</dc:creator>
		<pubDate>Fri, 16 Apr 2010 11:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-4996</guid>
		<description>Thanks for sharing the code. I was looking for the same what you did.

Thanks</description>
		<content:encoded><![CDATA[<p>Thanks for sharing the code. I was looking for the same what you did.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahsx</title>
		<link>http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/comment-page-1/#comment-4981</link>
		<dc:creator>Ahsx</dc:creator>
		<pubDate>Mon, 12 Apr 2010 20:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/generate-random-strings-in-as2-or-as3/#comment-4981</guid>
		<description>Hi, you don&#039;t need to split the pattern to an array.
He are my solution : 

public static function generate(length:int, pattern:String=&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;):String
		{
			var ret:String = &quot;&quot;;
			var n:int = 0;
			var mn:int = pattern.length;
			while(--length &gt; -1)
			{
				n = Math.random()*mn;
				ret += pattern.charAt(n);
			}
			
			return ret;
		}</description>
		<content:encoded><![CDATA[<p>Hi, you don&#8217;t need to split the pattern to an array.<br />
He are my solution : </p>
<p>public static function generate(length:int, pattern:String=&#8221;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&#8243;):String<br />
		{<br />
			var ret:String = &#8220;&#8221;;<br />
			var n:int = 0;<br />
			var mn:int = pattern.length;<br />
			while(&#8211;length &gt; -1)<br />
			{<br />
				n = Math.random()*mn;<br />
				ret += pattern.charAt(n);<br />
			}</p>
<p>			return ret;<br />
		}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

