<?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: Handling Basic Animation with a Divided Timeline</title>
	<atom:link href="http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/feed/" rel="self" type="application/rss+xml" />
	<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=basic-animation-as3-divided-timeline</link>
	<description>I help people make Flash games</description>
	<lastBuildDate>Thu, 09 Sep 2010 07:23:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-2398</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Tue, 11 Aug 2009 11:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-2398</guid>
		<description>&lt;p&gt;Hey Joe,&lt;/p&gt;

&lt;p&gt;If you want to avoid writing code directly into the FLA file (i.e. on the timeline) you can use &lt;a href=&quot;http://gamedev.michaeljameswilliams.com/2009/06/18/basic-animation-as3-state-movieclips/&quot; rel=&quot;nofollow&quot;&gt;State MovieClips&lt;/a&gt;. That&#039;d give you an easy way to bundle up all your layers into a single simple object as well.&lt;/p&gt;

&lt;p&gt;Let me know how you get on with that :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Joe,</p>

<p>If you want to avoid writing code directly into the <acronym title="Flash source document">FLA</acronym> file (i.e. on the timeline) you can use <a href="http://gamedev.michaeljameswilliams.com/2009/06/18/basic-animation-as3-state-movieclips/" rel="nofollow">State MovieClips</a>. That&#8217;d give you an easy way to bundle up all your layers into a single simple object as well.</p>

<p>Let me know how you get on with that <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-2393</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 11 Aug 2009 04:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-2393</guid>
		<description>&lt;p&gt;What if my Avatar is a character with a walkcycle of several layers and frames packaged into a MovieClip.  How can I get him to play only on keyPresses?
I have done it by writing code directly into the fla. file when I gave it an instance name, but I can&#039;t figure out how to do it in classes.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What if my Avatar is a character with a walkcycle of several layers and frames packaged into a MovieClip.  How can I get him to play only on keyPresses?
I have done it by writing code directly into the fla. file when I gave it an instance name, but I can&#8217;t figure out how to do it in classes.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Wesley: A Game Based on the AS3 Tutorial</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-2043</link>
		<dc:creator>Wesley: A Game Based on the AS3 Tutorial</dc:creator>
		<pubDate>Sun, 26 Jul 2009 00:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-2043</guid>
		<description>&lt;p&gt;[...] was really cool. Bram added in the walk-cycles and cola-throwing before I&#8217;d even written the animation and shoot-&#8217;em-up [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] was really cool. Bram added in the walk-cycles and cola-throwing before I&#8217;d even written the animation and shoot-&#8217;em-up [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1909</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Thu, 18 Jun 2009 00:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1909</guid>
		<description>&lt;p&gt;No problem :) The silly mistakes are often the hardest to spot, and the most annoying to find.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>No problem <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The silly mistakes are often the hardest to spot, and the most annoying to find.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: grey</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1908</link>
		<dc:creator>grey</dc:creator>
		<pubDate>Thu, 18 Jun 2009 00:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1908</guid>
		<description>&lt;p&gt;Once again I&#039;ve made a silly little mistake.  Thanks for the easy fix.  One of these days I&#039;ll make a non-typo mistake. :) thanks again.  Good catch.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Once again I&#8217;ve made a silly little mistake.  Thanks for the easy fix.  One of these days I&#8217;ll make a non-typo mistake. <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  thanks again.  Good catch.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1903</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Thu, 18 Jun 2009 00:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1903</guid>
		<description>&lt;p&gt;Hey Grey.&lt;/p&gt;

&lt;p&gt;Where exactly are you calling it from at the minute? I know you said &quot;when the enemy was created&quot; but if you could provide a snippet of the surrounding code that&#039;d be great.&lt;/p&gt;

&lt;p&gt;If it&#039;s somewhere here:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
    var newEnemy:Enemy = new Enemy( randomX, -15 );
    army.push( newEnemy );
    addChild( newEnemy );
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;...then I think it&#039;s just a simple typo -- you have written &lt;code&gt;enemy.gotoAndPlay()&lt;/code&gt; when it should be &lt;code&gt;newEnemy.gotoAndPlay()&lt;/code&gt;. But that&#039;s just a guess ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Grey.</p>

<p>Where exactly are you calling it from at the minute? I know you said &#8220;when the enemy was created&#8221; but if you could provide a snippet of the surrounding code that&#8217;d be great.</p>

<p>If it&#8217;s somewhere here:</p>

<p><pre>
    var newEnemy:Enemy = new Enemy( randomX, -15 );
    army.push( newEnemy );
    addChild( newEnemy );
</pre></p>

<p>&#8230;then I think it&#8217;s just a simple typo &#8212; you have written <code>enemy.gotoAndPlay()</code> when it should be <code>newEnemy.gotoAndPlay()</code>. But that&#8217;s just a guess <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Grey</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1896</link>
		<dc:creator>Grey</dc:creator>
		<pubDate>Wed, 17 Jun 2009 21:47:49 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1896</guid>
		<description>&lt;p&gt;Alright, I messed up again.  I&#039;m trying to make the random enemies have a different animation decided randomly.  I coded something like this, but I can&#039;t seem to figure out where or how to call this function properly.  It may even be in my naming.  Any ideas.  Here is my snippet of code&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;var randomAnimate = Math.floor(Math.random()*4);
                    if (randomAnimate == 1)
                    {
                        enemy.gotoAndPlay(&quot;ClockwiseCoal&quot;);
                    }
                    else 
                    {
                        enemy.gotoAndPlay(&quot;CounterClockwiseCoal&quot;);
                    }&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;I plan to have 3 animations, but I haven&#039;t done them because I wanted to get it working first.  I tried to call a function when the enemy was created, but I kept getting &quot;TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at AvoiderGame/onTick()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()&quot;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Alright, I messed up again.  I&#8217;m trying to make the random enemies have a different animation decided randomly.  I coded something like this, but I can&#8217;t seem to figure out where or how to call this function properly.  It may even be in my naming.  Any ideas.  Here is my snippet of code</p>

<p><pre>var randomAnimate = Math.floor(Math.random()*4);
                    if (randomAnimate == 1)
                    {
                        enemy.gotoAndPlay("ClockwiseCoal");
                    }
                    else 
                    {
                        enemy.gotoAndPlay("CounterClockwiseCoal");
                    }</pre></p>

<p>I plan to have 3 animations, but I haven&#8217;t done them because I wanted to get it working first.  I tried to call a function when the enemy was created, but I kept getting &#8220;TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at AvoiderGame/onTick()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()&#8221;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1798</link>
		<dc:creator>Michael Williams</dc:creator>
		<pubDate>Wed, 10 Jun 2009 13:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1798</guid>
		<description>&lt;p&gt;Nice one Kevin. Hey, you could use the rotation to affect the animation too, so an enemy walking upwards would only show the back of his head.&lt;/p&gt;

&lt;p&gt;Oh, WordPress comments seem to do that with code, it&#039;s really irritating.
To create your own code box you just use &quot;pre&quot; tags: &lt;pre&gt; before the code and &lt;/pre&gt; after it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nice one Kevin. Hey, you could use the rotation to affect the animation too, so an enemy walking upwards would only show the back of his head.</p>

<p>Oh, WordPress comments seem to do that with code, it&#8217;s really irritating.
To create your own code box you just use &#8220;pre&#8221; tags: &lt;pre&gt; before the code and &lt;/pre&gt; after it.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1793</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Tue, 09 Jun 2009 23:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1793</guid>
		<description>&lt;p&gt;yuck, sorry the code is hard to read, intresting that the last of it was put in a scrolling box.. hm... how would I &quot;box&quot; the code next time?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>yuck, sorry the code is hard to read, intresting that the last of it was put in a scrolling box.. hm&#8230; how would I &#8220;box&#8221; the code next time?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://gamedev.michaeljameswilliams.com/2009/06/03/basic-animation-as3-divided-timeline/comment-page-1/#comment-1792</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Tue, 09 Jun 2009 23:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=786#comment-1792</guid>
		<description>&lt;p&gt;Your missing something... Enemy animation change based on which direction he moves!, A little tricky... well until you play around with &quot;current label&quot;. This is a small chunk of my game, to get you started, especially if anyone needs the enemies to switch animations. Although as always, there is a better way to do it.&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;if (enemy.base.hitTestObject(wall)) {
                        if (enemy.front.hitTestObject(wall)) {
                            enemy.x-= xVel;
                            enemy.y-= yVel;
                            enemy.lockTarget.width = 0;
                        }
                        if (enemy.currentLabel == &quot;walk&quot;) {
                            enemy.gotoAndPlay(&quot;sit&quot;);
                            if (enemy.Left.hitTestObject(wall)) {
                                enemy.rotation += 1.8;
                        } else if (enemy.Right.hitTestObject(wall)) {
                            enemy.rotation -= 1.8;
                        }
                    }
                }
&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your missing something&#8230; Enemy animation change based on which direction he moves!, A little tricky&#8230; well until you play around with &#8220;current label&#8221;. This is a small chunk of my game, to get you started, especially if anyone needs the enemies to switch animations. Although as always, there is a better way to do it.</p>

<p><pre>if (enemy.base.hitTestObject(wall)) {
                        if (enemy.front.hitTestObject(wall)) {
                            enemy.x-= xVel;
                            enemy.y-= yVel;
                            enemy.lockTarget.width = 0;
                        }
                        if (enemy.currentLabel == "walk") {
                            enemy.gotoAndPlay("sit");
                            if (enemy.Left.hitTestObject(wall)) {
                                enemy.rotation += 1.8;
                        } else if (enemy.Right.hitTestObject(wall)) {
                            enemy.rotation -= 1.8;
                        }
                    }
                }
</pre></p>]]></content:encoded>
	</item>
</channel>
</rss>
