<?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>Stuck in a for loop &#187; Coding</title>
	<atom:link href="http://blog.kazumakzak.com/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kazumakzak.com</link>
	<description>*</description>
	<lastBuildDate>Sun, 06 Nov 2011 22:13:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quicktip: Good looking thousands</title>
		<link>http://blog.kazumakzak.com/2011/11/06/quicktip-good-looking-thousands/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quicktip-good-looking-thousands</link>
		<comments>http://blog.kazumakzak.com/2011/11/06/quicktip-good-looking-thousands/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 22:13:24 +0000</pubDate>
		<dc:creator>mattias</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.kazumakzak.com/?p=24</guid>
		<description><![CDATA[<p>This is a function I wrote way back to make large numbers look nicer. </p> private function separateByThousand&#40;valueNumber : Number, splitter : String = &#34; &#34;&#41; : String &#123; &#160; &#160; var valueString : String = &#34;&#34;; &#160; &#160; var valueLength : Number = valueNumber.toString&#40;&#41;.length; &#160; &#160; &#160; for &#40;var i : int = 0; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a function I wrote way back to make large numbers look nicer.  </p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple bwp-syntax-no-lines"><div class="actionscript3"><pre class="de1"><span class="kw1">private</span> <span class="kw3">function</span> separateByThousand<span class="br0">&#40;</span>valueNumber <span class="sy0">:</span> <span class="kw5">Number</span><span class="sy0">,</span> splitter <span class="sy0">:</span> <span class="kw5">String</span> = <span class="st0">&quot; &quot;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="kw5">String</span>
<span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw2">var</span> valueString <span class="sy0">:</span> <span class="kw5">String</span> = <span class="st0">&quot;&quot;</span><span class="sy0">;</span>
&nbsp; &nbsp; <span class="kw2">var</span> valueLength <span class="sy0">:</span> <span class="kw5">Number</span> = valueNumber<span class="sy0">.</span><span class="kw7">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="kw7">length</span><span class="sy0">;</span>
&nbsp;
&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i <span class="sy0">:</span> <span class="kw5">int</span> = <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> valueLength <span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span>
&nbsp; &nbsp; <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#40;</span>valueLength<span class="sy0">-</span>i<span class="br0">&#41;</span><span class="sy0">%</span>3 == <span class="nu0">0</span> <span class="sy0">&amp;&amp;</span> i <span class="sy0">!</span>= <span class="nu0">0</span><span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; valueString <span class="sy0">+</span>= splitter<span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; valueString <span class="sy0">+</span>= valueNumber<span class="sy0">.</span><span class="kw7">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="kw7">charAt</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; &nbsp; <span class="br0">&#125;</span>
&nbsp;
&nbsp; &nbsp; <span class="kw1">return</span> valueString<span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.kazumakzak.com/2011/11/06/quicktip-good-looking-thousands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Console 2.52</title>
		<link>http://blog.kazumakzak.com/2011/08/30/flash-console-2-52/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flash-console-2-52</link>
		<comments>http://blog.kazumakzak.com/2011/08/30/flash-console-2-52/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 08:44:55 +0000</pubDate>
		<dc:creator>mattias</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.kazumakzak.com/?p=21</guid>
		<description><![CDATA[<p>I have tested a new console for Flash called Flash-console v2.52 (created by <a title="Junkbyte" href="http://junkbyte.com/wp/" target="_blank">Lu Aye Oo</a>). This is by far the best console/monitor tool I&#8217;ve tried. With a few lines, you are up and running and have control over the FPS, memory, trace, channels, and more. You can open the command prompt, [...]]]></description>
			<content:encoded><![CDATA[<p>I have tested a new console for Flash called Flash-console v2.52 (created by <a title="Junkbyte" href="http://junkbyte.com/wp/" target="_blank">Lu Aye Oo</a>). This is by far the best console/monitor tool I&#8217;ve tried. With a few lines, you are up and running and have control over the FPS, memory, trace, channels, and more. You can open the command prompt, and modify instances at runtime. In the display the roles you get a list of all instances while hovering Them on stage. I know this has been done before, but this time it&#8217;s very well done.</p>
<p>I&#8217;m impressed.</p>
<p><strong>Download it here:</strong><br />
<a title="Flash Console" href="http://code.google.com/p/flash-console/" target="_blank">http://code.google.com/p/flash-console/</a></p>
<p><a href="http://blog.kazumakzak.com/wp-content/uploads/2011/08/console_controls.png"><img class="alignnone size-full wp-image-22" title="console_controls" src="http://blog.kazumakzak.com/wp-content/uploads/2011/08/console_controls.png" alt="" width="590" height="484" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kazumakzak.com/2011/08/30/flash-console-2-52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem with Shared Object data access</title>
		<link>http://blog.kazumakzak.com/2011/08/15/problem-with-shared-object-data-access/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=problem-with-shared-object-data-access</link>
		<comments>http://blog.kazumakzak.com/2011/08/15/problem-with-shared-object-data-access/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 14:16:21 +0000</pubDate>
		<dc:creator>mattias</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.kazumakzak.com/?p=18</guid>
		<description><![CDATA[<p>We had a problem in a recent game project getting SharedObject to store the players progress. When we tested it in Flash Builder it worked fine but as soon as we uploaded the game to our server (or any server) the data were not saved. We found out that to avoid name conflicts, Flash looks [...]]]></description>
			<content:encoded><![CDATA[<p>We had a problem in a recent game project getting SharedObject to store the players progress. When we tested it in Flash Builder it worked fine but as soon as we uploaded the game to our server (or any server) the data were not saved. We found out that to avoid name conflicts, Flash looks at the location of the SWF file creating the shared object. The solution to our problem was simple. By setting the local path to &#8220;/&#8221; We opened communication between the files. This means of course that all files in the same domain can access the object, so you have to watch out for conflicts if you have other projects on the same domain.</p>
<p><em>To avoid inadvertently restricting access to a shared object, use the <code>localpath</code> parameter. The most permissive approach is to set <code>localPath</code> to <code>/</code> (slash), which makes the shared object available to all SWF files in the domain, but increases the likelihood of name conflicts with other shared objects in the domain. A more restrictive approach is to append <code>localPath</code> with folder names that are in the full path to the SWF file. For example, for a <code>portfolio</code> shared object created by the SWF file at www.myCompany.com/apps/stockwatcher.swf, you could set the <code>localPath</code> parameter to <code>/</code>, <code>/apps</code>, or <code>/apps/stockwatcher.swf</code>. You must determine which approach provides optimal flexibility for your application.</em></p>
<p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html">Read more here</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kazumakzak.com/2011/08/15/problem-with-shared-object-data-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Games from the past (2004)</title>
		<link>http://blog.kazumakzak.com/2011/04/19/games-from-the-past-2004/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=games-from-the-past-2004</link>
		<comments>http://blog.kazumakzak.com/2011/04/19/games-from-the-past-2004/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 22:00:14 +0000</pubDate>
		<dc:creator>mattias</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://blog.kazumakzak.com/?p=12</guid>
		<description><![CDATA[<p>I found these two games that I created for a <a href="http://www.kirupa.com/forum/showthread.php?t=65403">flash game contest</a> at <a href="http://www.kirupa.com/">Kirupa</a> in 2004. Barefoot Longjump got <a href="http://www.kirupa.com/contest/game/index.htm">1st price</a>. The highscore does not work but I might fix that later. Probably not. Anyways … happy playing.</p> <p><a href="http://www.kazumakzak.com/games/hackysack/">http://www.kazumakzak.com/games/hackysack/</a><br /> <a href="http://www.kazumakzak.com/games/longjump">http://www.kazumakzak.com/games/longjump</a></p> <p>&#160;</p> <p>Hackysack<br /> <a href="http://www.kazumakzak.com/games/hackysack/"></a></p> <p>Barefoot Longjump<br /> [...]]]></description>
			<content:encoded><![CDATA[<p>I found these two games that I created for a <a href="http://www.kirupa.com/forum/showthread.php?t=65403">flash game contest</a> at <a href="http://www.kirupa.com/">Kirupa</a> in 2004. Barefoot Longjump got <a href="http://www.kirupa.com/contest/game/index.htm">1st price</a>. The highscore does not work but I might fix that later. Probably not. Anyways … happy playing.</p>
<p><a href="http://www.kazumakzak.com/games/hackysack/">http://www.kazumakzak.com/games/hackysack/</a><br />
<a href="http://www.kazumakzak.com/games/longjump">http://www.kazumakzak.com/games/longjump</a></p>
<p>&nbsp;</p>
<p><strong>Hackysack</strong><br />
<a href="http://www.kazumakzak.com/games/hackysack/"><img class="alignnone size-full wp-image-15" title="game-hackysack" src="http://blog.kazumakzak.com/wp-content/uploads/2011/04/game-hackysack.jpg" alt="" width="600" height="217" /></a></p>
<p><strong>Barefoot Longjump</strong><br />
<a href="http://www.kazumakzak.com/games/longjump"><img class="alignnone size-full wp-image-16" title="game-longjump" src="http://blog.kazumakzak.com/wp-content/uploads/2011/04/game-longjump.jpg" alt="" width="600" height="217" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kazumakzak.com/2011/04/19/games-from-the-past-2004/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript project Sandbox Error (Error #2044)</title>
		<link>http://blog.kazumakzak.com/2011/04/18/actionscript-project-sandbox-error-error-2044/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=actionscript-project-sandbox-error-error-2044</link>
		<comments>http://blog.kazumakzak.com/2011/04/18/actionscript-project-sandbox-error-error-2044/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 21:20:58 +0000</pubDate>
		<dc:creator>mattias</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.kazumakzak.com/?p=9</guid>
		<description><![CDATA[<p>When you are working on an Actionscript project with a generated swf in Flex/Flash Builder you sometimes need to pass the work to someone else for review. If your swf is loading another swf you will not be able to get the files to work correctly. As soon as you copy the files to a [...]]]></description>
			<content:encoded><![CDATA[<p>When you are working on an Actionscript project with a generated swf in Flex/Flash Builder you sometimes need to pass the work to someone else for review. If your swf is loading another swf you will not be able to get the files to work correctly. As soon as you copy the files to a local folder you are going to have problems because of the security in Flash player. If you run the html-file Flex/Flash Builder created you will get an error:</p>
<p><em><span style="color: #ff6600;">Error #2044: Unhandled SecurityErrorEvent:. text=Error #2140: Security sandbox violation: file:///Users/mattiaswargren/Documents/Flex Builder 3/my-project/bin-release/Main.swf cannot load file:///Users/mattiaswargren/Documents/Flex Builder 3/my-project/bin-release/assets.swf. Local-with-filesystem and local-with-networking SWF files cannot load each other.</span></em></p>
<p><strong>This is just the temporary solution to get it working in a local folder:</strong></p>
<ul>
<li>Right-click your project and select properties.</li>
<li>Select Actionscript Compiler.</li>
<li>Write <strong>-use-network=false</strong> in the textbox for Additional compiler parameters.</li>
</ul>
<p><img class="alignnone size-full wp-image-11" style="border-style: initial; border-color: initial;" title="Screen shot 2011-04-18 at 23.14.05" src="http://blog.kazumakzak.com/wp-content/uploads/2011/04/Screen-shot-2011-04-18-at-23.14.05.png" alt="" width="601" height="53" /></p>
<p>Next time you run this project it is ready for local use.</p>
<p>&nbsp;</p>
<p>You could also add the folder containing your files in the <strong>Global Security Settings panel</strong> found here:<br />
<a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html">http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kazumakzak.com/2011/04/18/actionscript-project-sandbox-error-error-2044/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using keyboard keycodes in Actionscript</title>
		<link>http://blog.kazumakzak.com/2011/04/18/using-keyboard-keycodes-in-actionscript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-keyboard-keycodes-in-actionscript</link>
		<comments>http://blog.kazumakzak.com/2011/04/18/using-keyboard-keycodes-in-actionscript/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 20:18:03 +0000</pubDate>
		<dc:creator>mattias</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.kazumakzak.com/?p=7</guid>
		<description><![CDATA[To view the flash content, please go to <a href="http://blog.kazumakzak.com/2011/04/18/using-keyboard-keycodes-in-actionscript/">Using keyboard keycodes in Actionscript</a><br /><br /><p>It is hard to remember the whole <a href="http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00001136.html">ASCII key list</a> when listening to keyboard events in Flash Actionscript. I usually use the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/ui/Keyboard.html">Keyboard Class</a> (flash.ui.Keyboard) when tracking keyboard inputs but it does not contain all the keys you may want to use. Instead of googling tables with Keyboard keycodes I made this SWF [...]]]></description>
			<content:encoded><![CDATA[To view the flash content, please go to <a href="http://blog.kazumakzak.com/2011/04/18/using-keyboard-keycodes-in-actionscript/">Using keyboard keycodes in Actionscript</a><br /><br /><p>It is hard to remember the whole <a href="http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00001136.html">ASCII key list</a> when listening to keyboard events in Flash Actionscript. I usually use the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/ui/Keyboard.html">Keyboard Class</a> (flash.ui.Keyboard) when tracking keyboard inputs but it does not contain all the keys you may want to use. Instead of googling tables with Keyboard keycodes I made this SWF to get quick access to the codes via the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/KeyboardEvent.html">KeyboardEvent</a> (flash.events.KeyboardEvent) class.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kazumakzak.com/2011/04/18/using-keyboard-keycodes-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

