<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">

	<channel>
		<title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Articles - ]]></title>
		<link>http://www.actionscript.org/resources</link>
		<description><![CDATA[ActionScript.org is the premier ActionScript developer community online for Flash and Flex users. One of the largest such sites in the world, ActionScript.org caters for designers and developers at all skill levels. The site includes thousands of tutorials, open source movies and scripts, support forums, reviews, scene news, a fully featured Flash jobs and employment section and much more.]]></description>
		<language>en-us</language>
		<copyright><![CDATA[http://www.actionscript.org/resources]]></copyright>
		<generator>N/A</generator>
		<webMaster>general.redirect@gmail.com</webMaster>
		<lastBuildDate>Sun, 19 May 2013 02:57:57 CDT</lastBuildDate>
		<ttl>20</ttl>
		<item>
			<title><![CDATA[How to build a currency formatting function for ActionScript2]]></title>
			<link>http://www.actionscript.org/resources/articles/1055/1/How-to-build-a-currency-formatting-function-for-ActionScript2/Page1.html</link>
			<description><![CDATA[<span>I just had an enquiry on how to format currency in flash 8 or ActionScript 2.</span><br/><br/><span>I thought it would be handy if I put it in an article so everyone can use it.</span><br/><br/><span>As you probably already know ActionScript2 doesn&#08217t have it's own built in currency formatting function, so you have to provide your own.</span><br/><br/><span>This example is from one of the currency formatting functions I have used for several years. </span><br/><br/><span>It's relatively simple in what it does, but in my view simple is good.</span><br/><br/><span>First of all, for those of you that want to know how to call the function, here is an example.</span><br/><br/><span> newFormatedVariable = formatAsDollars(yourVariable);</span><br/><br/><br/><span>Now for the function itself which is fairly straight forward .</span><br/><br/><span>Firstly we give the function a name.</span><br/><span>function formatAsDollars(amount)</span><br/><span>{</span><br/><span>Then we test to see if it is a number.</span><br/><span>    if (isNaN(amount))</span><br/><span>    {</span><br/><span>        return ("0.00");</span><br/><span>    } // end if</span><br/><span>Next we round it.</span><br/><span>    amount = Math.round(amount * 100) / 100;</span><br/><span>    var curr6 = String(amount);</span><br/><span>and split it at the decimal point</span><br/><span>    var curr3 = curr6.split(".");</span><br/><span>and place the results in an array.</span><br/><span>    if (curr3[1] == undefined)</span><br/><span>    {</span><br/><span>        curr3[1] = "00";</span><br/><span>    } // end if</span><br/><span>    if (curr3[1].length == 1)</span><br/><span>    {</span><br/><span>        curr3[1] = curr3[1] + "0";</span><br/><span>    } // end if</span><br/><span>After testing the values in each part of the array for length, we can then append the necessary zero if it needs it.</span><br/><br/><span>    var curr4 = new Array();</span><br/><span>    var curr2;</span><br/><span>We loop through the array</span><br/><span>    for (var curr1 = curr3[0].length; curr1 > 0; curr1 = curr2)</span><br/><span>    {</span><br/><span>We round up</span><br/><span>        curr2 = Math.max(curr1 - 3, 0);</span><br/><span>        curr4.unshift(curr3[0].slice(curr2, curr1));</span><br/><span>    } // end of for</span><br/><span>Now we rejoin the dollars and the cents</span><br/><span>    curr3[0] = curr4.join("");</span><br/><span>    return ("" + curr3.join("."));</span><br/><span>} // End of the function</span><br/><span>And out put the result.</span><br/><span>_root.onEnterFrame = function ()</span><br/><span>{</span><br/><span>    text_two.text = formatAsDollars(text_one.text);</span><br/><span>};</span><br/><br/><span> If
 you need more information on flash and Actionscript2 you will find some
 free tutorials on Asctionscript 2, and a lot of other content on 
building applications with Flash and ActionScript at: <a target="_blank"  href="http://www.interactivewebconcepts.net/">www.interactivewebconcepts.net</a></span><br/><br/> <br/>]]></description>
			<author>no@spam.com (Maurice Price)</author>
			<pubDate><![CDATA[Tue, 23 Nov 2010 00:00:00 CST]]></pubDate>
			<guid isPermaLink="true">http://www.actionscript.org/resources/articles/1055/1/How-to-build-a-currency-formatting-function-for-ActionScript2/Page1.html</guid>
		</item>
		<item>
			<title><![CDATA[Building database driven applications  using Flash, PHP and MySQL.]]></title>
			<link>http://www.actionscript.org/resources/articles/1051/1/Building-database-driven-applications--using-Flash-PHP-and-MySQL/Page1.html</link>
			<description><![CDATA[When I first started to build web applications with flash I had a bit of difficulty with the datagrid. I most of my web applications the datagrid is one of the most useful components. However, when you're new the DataGrid can be a little intimidating to get it to produce the results you want. I am going to give you a few tips on how to get a Flash DataGrid component to read data from a MySQL database.<br/>]]></description>
			<author>no@spam.com (Maurice Price)</author>
			<pubDate><![CDATA[Fri, 05 Nov 2010 04:30:00 CDT]]></pubDate>
			<guid isPermaLink="true">http://www.actionscript.org/resources/articles/1051/1/Building-database-driven-applications--using-Flash-PHP-and-MySQL/Page1.html</guid>
		</item>
	</channel>
</rss>