<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<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">
	<channel>
		<title>Starling Forum &#187; Topic: Sprite swapping MovieClips inside isn&#039;t working</title>
		<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working</link>
		<description>The Starling Framework Community</description>
		<language>en-US</language>
		<pubDate>Thu, 23 May 2013 08:13:24 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forum.starling-framework.org/search.php</link>
		</textInput>
		<atom:link href="http://forum.starling-framework.org/rss/topic/sprite-swapping-movieclips-inside-isnt-working" rel="self" type="application/rss+xml" />

		<item>
			<title>studiobrain on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-7836</link>
			<pubDate>Mon, 18 Jun 2012 16:15:51 +0000</pubDate>
			<dc:creator>studiobrain</dc:creator>
			<guid isPermaLink="false">7836@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Ahhhhh!  So simple it makes perfect sense  :lol:...  So for each animation in a sequence I would just repeat above, right?  And then on switch (change of animation) I just call chicken.play(&#34;chickenPop&#34;);  or chicken.play(&#34;chickenRun&#34;); or chicken.play(&#34;chickenStop&#34;); with no need for calling .stop()?&#60;/p&#62;
&#60;p&#62;Thanks for the response!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Ossi on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-7790</link>
			<pubDate>Mon, 18 Jun 2012 07:58:50 +0000</pubDate>
			<dc:creator>Ossi</dc:creator>
			<guid isPermaLink="false">7790@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Well, you use that class instead  &#38;lt;img src=&#38;quot;http://forum.starling-framework.org/my-plugins/bb-smilies/default/icon_smile.gif&#38;quot; title=&#38;quot;:-)&#38;quot; class=&#38;quot;bb_smilies&#38;quot; /&#38;gt; &#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;private&#60;/span&#62; &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; chicken&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;Animation = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; Animation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;FarmeScene.textureAtlas&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
chicken.addAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;chickenPop&#38;quot;&#60;/span&#62;, &#60;span style=&#34;color: #000000; font-weight:bold;&#34;&#62;30&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#60;span style=&#34;color: #004993;&#34;&#62;addChild&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;chicken&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
chicken.&#60;span style=&#34;color: #004993;&#34;&#62;play&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;chickenPop&#38;quot;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;


</description>
		</item>
		<item>
			<title>studiobrain on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-7785</link>
			<pubDate>Mon, 18 Jun 2012 05:03:55 +0000</pubDate>
			<dc:creator>studiobrain</dc:creator>
			<guid isPermaLink="false">7785@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;osro, a little late to the party but how would you call this class for use.  As to say I have a MovieClip class (chicken):&#60;br /&#62;
&#60;code&#62;private var chickenPop:MovieClip = new MovieClip(FarmScene.textureAtlas.getTextures(&#34;chickenPop&#34;), 30);&#60;/code&#62;&#60;br /&#62;
, so how do I transfer chicken to your class?&#60;/p&#62;
&#60;p&#62;chicken.addAnimation()?  chicken.play()?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jota on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5667</link>
			<pubDate>Sun, 29 Apr 2012 02:04:44 +0000</pubDate>
			<dc:creator>Jota</dc:creator>
			<guid isPermaLink="false">5667@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Still don't know.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MacShrike on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5498</link>
			<pubDate>Thu, 26 Apr 2012 14:24:24 +0000</pubDate>
			<dc:creator>MacShrike</dc:creator>
			<guid isPermaLink="false">5498@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;So it was the juggler then?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jota on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5476</link>
			<pubDate>Thu, 26 Apr 2012 01:51:01 +0000</pubDate>
			<dc:creator>Jota</dc:creator>
			<guid isPermaLink="false">5476@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Yeah, it does work. With some adaptations to my code, but works fine. I'm just wondering why my code was not working =/&#60;/p&#62;
&#60;p&#62;Thank you osro&#60;/p&#62;
&#60;p&#62;Solved
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jota on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5472</link>
			<pubDate>Thu, 26 Apr 2012 00:54:38 +0000</pubDate>
			<dc:creator>Jota</dc:creator>
			<guid isPermaLink="false">5472@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;I'll try it.&#60;/p&#62;
&#60;p&#62;Just a sec.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Ossi on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5471</link>
			<pubDate>Thu, 26 Apr 2012 00:45:14 +0000</pubDate>
			<dc:creator>Ossi</dc:creator>
			<guid isPermaLink="false">5471@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;These functions are basicly what I have in my Animation class.&#60;br /&#62;
And it just extends Starling sprite.&#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;private&#60;/span&#62; &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; _animations&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Dictionary&#60;/span&#62;;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;private&#60;/span&#62; &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; _atlas&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;TextureAtlas;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;private&#60;/span&#62; &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; _currentAnimation&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;String&#60;/span&#62;;
&#38;nbsp;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; Animation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;atlas&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;TextureAtlas&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
            &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;super&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
            _animations = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;Dictionary&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
            _atlas = atlas;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;
&#38;nbsp;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;play&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;String&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
            &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;if&#60;/span&#62; &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_currentAnimation == &#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;
                &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;return&#60;/span&#62;;
&#38;nbsp;
            &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;if&#60;/span&#62; &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;!&#60;/span&#62;_animations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#91;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#93;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;
                &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;throw&#60;/span&#62; &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;Error&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;No animation called &#38;quot;&#60;/span&#62; &#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;+&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
            &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;if&#60;/span&#62; &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;
            &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
                &#60;span style=&#34;color: #004993;&#34;&#62;removeChild&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_animations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#91;&#60;/span&#62;_currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#93;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
                Starling.juggler.remove&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_animations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#91;&#60;/span&#62;_currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#93;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
            &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;
&#38;nbsp;
            &#60;span style=&#34;color: #004993;&#34;&#62;addChild&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_animations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#91;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#93;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
            Starling.juggler.&#60;span style=&#34;color: #004993;&#34;&#62;add&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_animations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#91;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#93;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
            _currentAnimation = &#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;
&#38;nbsp;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; addAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;String&#60;/span&#62;, &#60;span style=&#34;color: #004993;&#34;&#62;frameRate&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Number&#60;/span&#62; = &#60;span style=&#34;color: #000000; font-weight:bold;&#34;&#62;0&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
            &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; newMC&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62; = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;_atlas.getTextures&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;, &#60;span style=&#34;color: #004993;&#34;&#62;frameRate&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
            _animations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#91;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;name&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#93;&#60;/span&#62; = newMC;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;


</description>
		</item>
		<item>
			<title>Jota on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5470</link>
			<pubDate>Thu, 26 Apr 2012 00:44:08 +0000</pubDate>
			<dc:creator>Jota</dc:creator>
			<guid isPermaLink="false">5470@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Actually, I only advance time from currentAnimation. Adding this class to the juggler and overriting the method advanceTime, it indirectly adds the animation to the juggler.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MacShrike on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5469</link>
			<pubDate>Thu, 26 Apr 2012 00:35:06 +0000</pubDate>
			<dc:creator>MacShrike</dc:creator>
			<guid isPermaLink="false">5469@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;HI,&#60;/p&#62;
&#60;p&#62;just a stab in the dark, but shouldn't you also remove and add the currentmovieclip to the juggler?&#60;/p&#62;
&#60;p&#62;Mac
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jota on "Sprite swapping MovieClips inside isn&#039;t working"</title>
			<link>http://forum.starling-framework.org/topic/sprite-swapping-movieclips-inside-isnt-working#post-5468</link>
			<pubDate>Wed, 25 Apr 2012 23:44:57 +0000</pubDate>
			<dc:creator>Jota</dc:creator>
			<guid isPermaLink="false">5468@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;I'm trying to do a class that holds a bunch of MovieClips inside. Than I call playAnimation(&#34;idle&#34;), than it animate the idle animation. I haven't thought about a class to extends from, so I made this way:&#60;/p&#62;
&#60;p&#62;- I create all my MovieClips&#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; static &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; appearing&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; static &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;loop&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; static &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; exploding&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;;
&#38;nbsp;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; drawAnimations&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
	&#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; texture&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;Texture = Assets.getTexture&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;SpriteSheet&#38;quot;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	&#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; xml&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;XML&#60;/span&#62; = &#60;span style=&#34;color: #004993;&#34;&#62;XML&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; SpriteSheetXML&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	&#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; textureAtlas&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;TextureAtlas = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; TextureAtlas&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;texture, xml&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	&#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; frames&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;Vector.&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;&#38;lt;&#60;/span&#62;Texture&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;&#38;gt;&#60;/span&#62; = textureAtlas.getTextures&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;Appearing&#38;quot;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	appearing = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;frames, &#60;span style=&#34;color: #000000; font-weight:bold;&#34;&#62;24&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
	appearing.&#60;span style=&#34;color: #004993;&#34;&#62;addEventListener&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Event&#60;/span&#62;.&#60;span style=&#34;color: #004993;&#34;&#62;COMPLETE&#60;/span&#62;, gotoLoop&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;	
&#38;nbsp;
	frames = textureAtlas.getTextures&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;Loop&#38;quot;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	&#60;span style=&#34;color: #004993;&#34;&#62;loop&#60;/span&#62; = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;frames, &#60;span style=&#34;color: #000000; font-weight:bold;&#34;&#62;24&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	frames = textureAtlas.getTextures&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #990000;&#34;&#62;&#38;quot;Exploding&#38;quot;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	exploding = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;new&#60;/span&#62; &#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;frames, &#60;span style=&#34;color: #000000; font-weight:bold;&#34;&#62;24&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
	exploding.&#60;span style=&#34;color: #004993;&#34;&#62;addEventListener&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Event&#60;/span&#62;.&#60;span style=&#34;color: #004993;&#34;&#62;COMPLETE&#60;/span&#62;, remove&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;



&#60;p&#62;- Than I implement IAnimatable, create a variable named currentAnimation and override advanceTime method.&#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;private&#60;/span&#62; &#60;span style=&#34;color: #6699cc; font-weight: bold;&#34;&#62;var&#60;/span&#62; _currentAnimation&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;;
&#38;nbsp;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; advanceTime&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;passedTime&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Number&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
	&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;if&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;
		currentAnimation.advanceTime&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;passedTime&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;



&#60;p&#62;- After all that, I made a get/set function for currentAnimation. All I have to do then is to call playAnimation(name:String), which sets the new animation.&#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;get&#60;/span&#62; currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62; &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62; &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;return&#60;/span&#62; _currentAnimation; &#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;
&#38;nbsp;
&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;set&#60;/span&#62; currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;value&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;MovieClip&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
	&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;if&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;
		&#60;span style=&#34;color: #004993;&#34;&#62;removeChild&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	_currentAnimation = &#60;span style=&#34;color: #004993;&#34;&#62;value&#60;/span&#62;;
&#38;nbsp;
	&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;if&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;currentAnimation == &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;null&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62; &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;return&#60;/span&#62;;
&#38;nbsp;
	&#60;span style=&#34;color: #004993;&#34;&#62;addChild&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;currentAnimation&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#38;nbsp;
	currentAnimation.&#60;span style=&#34;color: #004993;&#34;&#62;play&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;



&#60;p&#62;If I'm not doing anything wrong, it should be working. Im my case, occurs the following:&#60;br /&#62;
- I play appering movieclip. It plays 'til the end, where an Event.COMPLETE is dispathing.&#60;br /&#62;
- In the Event.COMPLETE method, I set the currentAnimation to loop.&#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; gotoLoop&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;event&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Event&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
	currentAnimation = &#60;span style=&#34;color: #004993;&#34;&#62;loop&#60;/span&#62;;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;



&#60;p&#62;Here starts my problem: the event is dispatched, it goes inside the function, set the animation but it don't play. It keeps displaying the last frame of &#34;appearing&#34; animation. In set method, it changed to the new animation. But if I trace the currentAnimation outside the set method, it still giving me &#34;appearing&#34; animation, as it haven't changed inside the function. Anyone knows where I'm mistaken?&#60;/p&#62;
&#60;p&#62;Another 'bug' is the exploding animation is loop = false. In its Event.COMPLETE method, I remove the currentAnimation but the last frame is still rendering. Is that normal?&#60;/p&#62;


&#60;div class=&#34;bb_syntax&#34;&#62;&#60;div class=&#34;code&#34;&#62;&#60;pre class=&#34;as3&#34; style=&#34;font-family:monospace;&#34;&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;public&#60;/span&#62; &#60;span style=&#34;color: #339966; font-weight: bold;&#34;&#62;function&#60;/span&#62; remove&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#40;&#60;/span&#62;event&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #004993;&#34;&#62;Event&#60;/span&#62;&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#41;&#60;/span&#62;&#60;span style=&#34;color: #000000; font-weight: bold;&#34;&#62;:&#60;/span&#62;&#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;void&#60;/span&#62;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#123;&#60;/span&#62;
	currentAnimation = &#60;span style=&#34;color: #0033ff; font-weight: bold;&#34;&#62;null&#60;/span&#62;;
&#60;span style=&#34;color: #000000;&#34;&#62;&#38;#125;&#60;/span&#62;&#60;/pre&#62;&#60;/div&#62;&#60;/div&#62;



&#60;p&#62;Thank to all.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
