<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Understanding Flash&#8217;s Coordinate Systems</title>
	<atom:link href="http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/feed/" rel="self" type="application/rss+xml" />
	<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/</link>
	<description>I help people make Flash games</description>
	<lastBuildDate>Sat, 20 Mar 2010 16:28:21 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-3077</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Wed, 21 Oct 2009 16:29:19 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-3077</guid>
		<description>&lt;p&gt;If you&#039;re looking for a more practical application of all this, check out &lt;a href=&quot;http://active.tutsplus.com/tutorials/games/add-depth-to-your-game-with-parallax-scrolling/&quot; rel=&quot;nofollow&quot;&gt;my new tutorial on parallax scrolling&lt;/a&gt;.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you&#8217;re looking for a more practical application of all this, check out <a href="http://active.tutsplus.com/tutorials/games/add-depth-to-your-game-with-parallax-scrolling/" rel="nofollow">my new tutorial on parallax scrolling</a>.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-3009</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Fri, 09 Oct 2009 15:48:31 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-3009</guid>
		<description>&lt;p&gt;Thank you Free Games :)
Haha, yes the same thing happens with me, I often find posts just &lt;em&gt;after&lt;/em&gt; I need them :P&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you Free Games <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 
Haha, yes the same thing happens with me, I often find posts just <em>after</em> I need them <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Free Games</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-3003</link>
		<dc:creator>Free Games</dc:creator>
		<pubDate>Wed, 07 Oct 2009 18:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-3003</guid>
		<description>&lt;p&gt;Awesome post, thanks for all the detail. I&#039;ve been struggling with learning actionscript and its websites like yours that keep allowing me to make slow and steady progress. Of course, I usually find websites like yours after I have beaten my head bloody against the wall trying to figure out some of these quirks! Thanks again!&lt;/p&gt;

&lt;p&gt;.-= Free Games´s last blog: &lt;a href=&quot;http://freegamesgallery.com/play/1994/square-jump&quot; rel=&quot;nofollow&quot;&gt;Square Jump&lt;/a&gt; =-.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Awesome post, thanks for all the detail. I&#8217;ve been struggling with learning actionscript and its websites like yours that keep allowing me to make slow and steady progress. Of course, I usually find websites like yours after I have beaten my head bloody against the wall trying to figure out some of these quirks! Thanks again!</p>

<p><span class="cluv"> Free Games´s last blog: <a href="http://freegamesgallery.com/play/1994/square-jump" rel="nofollow">Square Jump</a> </span></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2619</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Thu, 20 Aug 2009 11:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2619</guid>
		<description>&lt;p&gt;Thanks, Porter!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks, Porter!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Porter</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2602</link>
		<dc:creator>Porter</dc:creator>
		<pubDate>Thu, 20 Aug 2009 01:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2602</guid>
		<description>&lt;p&gt;That&#039;s definitely the most in depth explanation I&#039;ve ever seen. If ever I need to explain this to someone, this is definitely where I&#039;ll send them, great work.&lt;/p&gt;

&lt;p&gt;.-= Porter´s last blog: &lt;a href=&quot;http://blog.princeporter.com/?p=367&quot; rel=&quot;nofollow&quot;&gt;Do Sponsors Care About More Than CTR?&lt;/a&gt; =-.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That&#8217;s definitely the most in depth explanation I&#8217;ve ever seen. If ever I need to explain this to someone, this is definitely where I&#8217;ll send them, great work.</p>

<p><span class="cluv"> Porter´s last blog: <a href="http://blog.princeporter.com/?p=367" rel="nofollow">Do Sponsors Care About More Than CTR?</a> </span></p>]]></content:encoded>
	</item>
	<item>
		<title>By: arxanas</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2479</link>
		<dc:creator>arxanas</dc:creator>
		<pubDate>Sat, 15 Aug 2009 01:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2479</guid>
		<description>&lt;p&gt;Okay then, that&#039;s what I needed to know. Thanks!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Okay then, that&#8217;s what I needed to know. Thanks!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2475</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Fri, 14 Aug 2009 23:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2475</guid>
		<description>&lt;p&gt;The lowest object in a container has an index of 0, and none can be negative.&lt;/p&gt;

&lt;p&gt;All the DisplayObjects within a DisplayObjectContainer have an index from 0 to ( number of display objects - 1 ). If one of those DisplayObjects happens to be a DisplayObjectContainer itself, and contain even more DisplayObjects, then each of &lt;em&gt;those&lt;/em&gt; DisplayObjects has an index from 0 to ( number of display objects in the inner DisplayObjectContainer - 1 ). And so on.&lt;/p&gt;

&lt;p&gt;It&#039;s called a &quot;composite pattern&quot;; it&#039;s self-similar, like a fractal. Hard to explain in text, haha!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The lowest object in a container has an index of 0, and none can be negative.</p>

<p>All the DisplayObjects within a DisplayObjectContainer have an index from 0 to ( number of display objects &#8211; 1 ). If one of those DisplayObjects happens to be a DisplayObjectContainer itself, and contain even more DisplayObjects, then each of <em>those</em> DisplayObjects has an index from 0 to ( number of display objects in the inner DisplayObjectContainer &#8211; 1 ). And so on.</p>

<p>It&#8217;s called a &#8220;composite pattern&#8221;; it&#8217;s self-similar, like a fractal. Hard to explain in text, haha!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: arxanas</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2466</link>
		<dc:creator>arxanas</dc:creator>
		<pubDate>Fri, 14 Aug 2009 13:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2466</guid>
		<description>&lt;p&gt;Ah, very useful. I remember someone at FrozenHaddock&#039;s forum asked how to keep stuff on top (namely, a mute button). This would have been rather useful to whomever that was. Can indexes (indices, whatever) also go negative? Or is it all above zero?&lt;/p&gt;

&lt;p&gt;And do these containers exist on certain indexes, which then have some sort of virtual &quot;sub-indexes&quot;?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ah, very useful. I remember someone at FrozenHaddock&#8217;s forum asked how to keep stuff on top (namely, a mute button). This would have been rather useful to whomever that was. Can indexes (indices, whatever) also go negative? Or is it all above zero?</p>

<p>And do these containers exist on certain indexes, which then have some sort of virtual &#8220;sub-indexes&#8221;?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2446</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Thu, 13 Aug 2009 16:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2446</guid>
		<description>&lt;p&gt;Sure -- actually there are several ways. As I understand it, AS2 gave every object a &quot;depth index&quot;, right? AS3 does a similar thing, but with one big exception: there are no gaps. So, you can&#039;t have an object with index 4 and then insert the next one at index 1000. Also, if you have objects at index 0, 1, and 2 (say), then insert another item at index 1, the objects currently at index 1 and 2 will move to indices 3 and 4.&lt;/p&gt;

&lt;p&gt;The relevant functions are:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#getChildIndex()&quot; rel=&quot;nofollow&quot;&gt;container.getChildIndex( child:DisplayObject ):int&lt;/a&gt; -- gets the depth index of the child object within &lt;code&gt;container&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#setChildIndex()&quot; rel=&quot;nofollow&quot;&gt;container.setChildIndex( child:DisplayObject, index:int )&lt;/a&gt; -- sets the depth index of the child object within &lt;code&gt;container&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#addChildAt()&quot; rel=&quot;nofollow&quot;&gt;container.addChildAt( child:DisplayObject, index:int )&lt;/a&gt; -- like &lt;code&gt;addChild()&lt;/code&gt; except inserts the new object at the specified index within &lt;code&gt;container&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#getChildAt()&quot; rel=&quot;nofollow&quot;&gt;container.getChildAt( index:int ):DisplayObject&lt;/a&gt; -- gets the object within &lt;code&gt;container&lt;/code&gt; at the given index.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#swapChildren()&quot; rel=&quot;nofollow&quot;&gt;container.swapChildren( child1:DisplayObject, child2:DisplayObject )&lt;/a&gt; -- swaps the indices of the two objects specified (must be within &lt;code&gt;container&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#swapChildrenAt()&quot; rel=&quot;nofollow&quot;&gt;container.swapChildrenAt( index1:int, index2:int )&lt;/a&gt; -- swaps the indices of the two objects that are at the given indices.&lt;/p&gt;

&lt;p&gt;And of course you can combine these, like writing &lt;code&gt;container.addChildAt( newBullet, getChildIndex( gun ) - 1 )&lt;/code&gt; to add the new bullet underneath the gun.&lt;/p&gt;

&lt;p&gt;Personally I really like using the method you suggested, separating objects into different containers. This is particularly useful for making a HUD that doesn&#039;t scroll and a background that scrolls at a different rate to the main sprites.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Sure &#8212; actually there are several ways. As I understand it, <acronym title="ActionScript 2">AS2</acronym> gave every object a &#8220;depth index&#8221;, right? <acronym title="ActionScript 3">AS3</acronym> does a similar thing, but with one big exception: there are no gaps. So, you can&#8217;t have an object with index 4 and then insert the next one at index 1000. Also, if you have objects at index 0, 1, and 2 (say), then insert another item at index 1, the objects currently at index 1 and 2 will move to indices 3 and 4.</p>

<p>The relevant functions are:</p>

<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#getChildIndex()" rel="nofollow">container.getChildIndex( child:DisplayObject ):int</a> &#8212; gets the depth index of the child object within <code>container</code>.</p>

<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#setChildIndex()" rel="nofollow">container.setChildIndex( child:DisplayObject, index:int )</a> &#8212; sets the depth index of the child object within <code>container</code>.</p>

<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#addChildAt()" rel="nofollow">container.addChildAt( child:DisplayObject, index:int )</a> &#8212; like <code>addChild()</code> except inserts the new object at the specified index within <code>container</code>.</p>

<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#getChildAt()" rel="nofollow">container.getChildAt( index:int ):DisplayObject</a> &#8212; gets the object within <code>container</code> at the given index.</p>

<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#swapChildren()" rel="nofollow">container.swapChildren( child1:DisplayObject, child2:DisplayObject )</a> &#8212; swaps the indices of the two objects specified (must be within <code>container</code>)</p>

<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#swapChildrenAt()" rel="nofollow">container.swapChildrenAt( index1:int, index2:int )</a> &#8212; swaps the indices of the two objects that are at the given indices.</p>

<p>And of course you can combine these, like writing <code>container.addChildAt( newBullet, getChildIndex( gun ) - 1 )</code> to add the new bullet underneath the gun.</p>

<p>Personally I really like using the method you suggested, separating objects into different containers. This is particularly useful for making a HUD that doesn&#8217;t scroll and a background that scrolls at a different rate to the main sprites.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: arxanas</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/08/07/understanding-flashs-coordinate-systems/comment-page-1/#comment-2436</link>
		<dc:creator>arxanas</dc:creator>
		<pubDate>Thu, 13 Aug 2009 03:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=897#comment-2436</guid>
		<description>&lt;p&gt;Is there a way to rearrange the order of these containers? For example, in my game, I&#039;m firing bullets, but they appear on top of the gun and start moving, as opposed to under, so it seems as though it&#039;s actually leaving the gun. I know AS2 had depth control, but does AS3 have any such thing?&lt;/p&gt;

&lt;p&gt;Although the logical solution is probably to create a container for the bullets (and organize every type of object in the game) beneath the gun...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Is there a way to rearrange the order of these containers? For example, in my game, I&#8217;m firing bullets, but they appear on top of the gun and start moving, as opposed to under, so it seems as though it&#8217;s actually leaving the gun. I know <acronym title="ActionScript 2">AS2</acronym> had depth control, but does <acronym title="ActionScript 3">AS3</acronym> have any such thing?</p>

<p>Although the logical solution is probably to create a container for the bullets (and organize every type of object in the game) beneath the gun&#8230;</p>]]></content:encoded>
	</item>
</channel>
</rss>
