<?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>Patrick Gunderson &#187; Events</title>
	<atom:link href="http://pat.theorigin.net/tag/events/feed/" rel="self" type="application/rss+xml" />
	<link>http://pat.theorigin.net</link>
	<description>Art, Design, Code</description>
	<lastBuildDate>Fri, 02 Sep 2011 19:33:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Sequencing Events in Flash</title>
		<link>http://pat.theorigin.net/2008/10/28/sequencing-events-in-flash/</link>
		<comments>http://pat.theorigin.net/2008/10/28/sequencing-events-in-flash/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 08:52:49 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://pat.theorigin.net/?p=77</guid>
		<description><![CDATA[While over on the flashkit boards yesterday I was going through the various posts and lending a hand where I could – as I do most days – and I came across two people who were asking pretty much the &#8230; <a href="http://pat.theorigin.net/2008/10/28/sequencing-events-in-flash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While over on the flashkit boards yesterday I was going<br />
through the various posts and lending a hand where I could – as I do most<br />
days – and I came across two people who were asking pretty much the same<br />
question: &#8220;How do I sequence events using the mx.transitions.Tween class?&#8221;</p>
<p>They were both trying to use the onMotionFinished() event<br />
handler to cause events to fire in a set sequence and wanted to know how to<br />
cause an event to be called at a time other than exactly when the motion from<br />
the Tween was completed.</p>
<p>The problem here is that onMotionFinished() isn’t meant for<br />
hardcore event sequencing… that’s what the timeline is for. The timeline is the<br />
only real reason to buy the full flash suite, and ignoring it, especially for<br />
sequencing is ignorant.</p>
<p>In the end I offered three solutions:</p>
<ul>
<li>Create a series of setInterval() functions that are timed to<br />
    execute your tweens. While not ideally flexible, this method does allow<br />
    manipulation of the sequence in milliseconds, and all from a single screen. You<br />
    must remember to add a clearInterval() to the function that the setInterval()<br />
    calls or else your tween will happen over and over again.</li>
<li>The best solution is to place the tween actions on different<br />
    frames and use the timeline to space those frames. This provides an easy to<br />
    adjust, graphical representation of the sequence and maintains the tween class<br />
    benefit of being able to use built-in easing.</li>
<li>Another solution, while not ideal for large, complex<br />
    animations, is to take the tween class away, and manually tween the items on<br />
    the timeline.</li>
</ul>
<p>All of these solutions will work well for static animations<br />
such as those found in intros, scene changes, and button animations, but the<br />
Tween class’s real power is in interactive animation. Interactive animations<br />
are determined at runtime. They use variables that are dependant on the users<br />
actions and are likely to be different every time.</p>
<p>The Tween Class has a cool method called continueTo() which<br />
can give a tween a new destination. If you link that new destination to the<br />
_xmouse or _ymouse properties you’ll quickly see the potential power of the<br />
tween class.</p>
<p>In conclusion, while it is generally best practice to have<br />
all your ActionScript on frame 1 of your Flash movies, it’s ok to use the tween<br />
class (or any ActionScript) in combination with the timeline if you know you<br />
want a series of actions to happen at pre-determined times. That what the<br />
timeline is for.</p>
]]></content:encoded>
			<wfw:commentRss>http://pat.theorigin.net/2008/10/28/sequencing-events-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

