<?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>Dan Myers &#187; Actionscript</title>
	<atom:link href="http://www.danmyers.name/wp/category/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danmyers.name/wp</link>
	<description>PHP, ActionScript, TorqueScript, Frameworks</description>
	<lastBuildDate>Fri, 27 Aug 2010 12:11:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Using a hyphen in a post variable using LoadVars</title>
		<link>http://www.danmyers.name/wp/2009/11/using-a-hyphen-in-a-post-variable-using-loadvars/</link>
		<comments>http://www.danmyers.name/wp/2009/11/using-a-hyphen-in-a-post-variable-using-loadvars/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 19:49:27 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://www.danmyers.name/wp/?p=75</guid>
		<description><![CDATA[If you&#8217;ve ever tried to use LoadVars to send a form that requires a hyphen in the variable name, you might be pulling your hair out right now.  For example, lets say you&#8217;re trying to submit a form variable like this: loginin-id=15 So, in Flash, you probably tried something like this: var loadVarsSender:LoadVars = new [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to use LoadVars to send a form that requires a hyphen in the variable name, you might be pulling your hair out right now.  For example, lets say you&#8217;re trying to submit a form variable like this:</p>
<p>loginin-id=15</p>
<p>So, in Flash, you probably tried something like this:</p>
<pre class="brush: as3;">var loadVarsSender:LoadVars = new LoadVars();
loadVarsSender.login-id=&quot;Some data&quot;;
var loadVarsReceiver:LoadVars = new LoadVars();
loadVarsSender.sendAndLoad(&quot;somepage.php&quot;, loadVarsReceiver, &quot;POST&quot;);</pre>
<p>But the problem is that Flash sees that as login minus id.  It&#8217;s treating the hyphen as a subtraction operator.  The solution, wrap the variable name in square braces like so:</p>
<pre class="brush: as3;">var loadVarsSender:LoadVars = new LoadVars();
loadVarsSender[&quot;login-id&quot;]=&quot;Some data&quot;;
var loadVarsReceiver:LoadVars = new LoadVars();
loadVarsSender.sendAndLoad(&quot;somepage.php&quot;, loadVarsReceiver, &quot;POST&quot;);</pre>
<p>That&#8217;ll tell flash that the hyphen is part of the variable name.  This should work for any other strange characters that you need to use in the variable name too.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 31px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">var loadVarsSender:LoadVars = new LoadVars();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 31px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">loadVarsSender.text_org=&#8221;Some data&#8221;;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 31px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">var loadVarsReceiver:LoadVars = new LoadVars();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 31px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">
<p>loadVarsSender.sendAndLoad(&#8220;somepage.php&#8221;, loadVarsReceiver, &#8220;POST&#8221;);</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.danmyers.name/wp/2009/11/using-a-hyphen-in-a-post-variable-using-loadvars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Only allow numbers in an input field in AS2</title>
		<link>http://www.danmyers.name/wp/2009/08/only-allow-numbers-in-an-input-field-in-as2/</link>
		<comments>http://www.danmyers.name/wp/2009/08/only-allow-numbers-in-an-input-field-in-as2/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 17:15:26 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://www.danmyers.name/wp/?p=65</guid>
		<description><![CDATA[If you&#8217;ve ever created a form using ActionScript 2, you know that sometimes you want to limit what characters a user can type into a given field. For example, if you&#8217;re asking the user to enter their age, or a zip code, they certainly don&#8217;t need to use letters. So you can restrict the user [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever created a form using ActionScript 2, you know that sometimes you want to limit what characters a user can type into a given field.  For example, if you&#8217;re asking the user to enter their age, or a zip code, they certainly don&#8217;t need to use letters.  So you can restrict the user to only be able to type certain keys on the keyboard when they&#8217;re in that field.  Here&#8217;s how:</p>
<p><strong>myinputfield_txt.restrict = &#8220;0-9&#8243;;</strong></p>
<p>This tells Flash to only allow the numbers 0-9 to be typed into that field.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danmyers.name/wp/2009/08/only-allow-numbers-in-an-input-field-in-as2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

