<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.11" -->
<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/"
	>

<channel>
	<title>thomas stanley / staticmethods</title>
	<link>http://staticmethods.com/blog</link>
	<description></description>
	<pubDate>Fri, 03 Apr 2009 05:03:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>
	<language>en</language>
			<item>
		<title>AS2 SequentialLoader Class:</title>
		<link>http://staticmethods.com/blog/archives/6</link>
		<comments>http://staticmethods.com/blog/archives/6#comments</comments>
		<pubDate>Tue, 29 Jan 2008 06:20:28 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category>ActionScript 2</category>

		<guid isPermaLink="false">http://staticmethods.com/blog/?p=6</guid>
		<description><![CDATA[A long while back, i needed to write a class that could be used to load a series of swfs or images in sequence, and monitor the progress of each item in the sequence or the sequence as a whole. SequentialLoader is what i came up with, and it has come in handy every once [...]]]></description>
			<content:encoded><![CDATA[<p>A long while back, i needed to write a class that could be used to load a series of swfs or images in sequence, and monitor the progress of each item in the sequence or the sequence as a whole. SequentialLoader is what i came up with, and it has come in handy every once and a while since. Essentially, the instance is created by passing in an array of assets (images or swfs) and an array of holder MCs to load the assets into. Once instantiated, startLoad can be called on the SequentialLoader instance, and the instance will broadcast events to anything that has registered as a listener.</p>
<p>Now that i'm thinking about making it publicly available, i've decided to go back and clean it up a bit. It should be done in a day or two, and when it's ready, i'll post the code, and an example for download. Check back for updates to this post...</p>
<p>Here's a really simple example of how the class is used:</p>
<div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showPlainTxt('actionscript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">staticmethods</span>.<span style="color: #006600;">loader</span>.<span style="color: #006600;">SequentialLoader</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> assets:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"one.jpg"</span>, <span style="color: #ff0000;">"two.jpg"</span>, <span style="color: #ff0000;">"three.jpg"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> holders:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span>holder1_mc, holder2_mc, holder3_mc<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> sl:SequentialLoader = <span style="color: #000000; font-weight: bold;">new</span> SequentialLoader<span style="color: #66cc66;">&#40;</span>assets, holders<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sl.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>SequentialLoader.<span style="color: #006600;">EVENT_SEQUENCE_COMPLETE</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">handleSequenceComplete</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sl.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> handleSequenceComplete<span style="color: #66cc66;">&#40;</span>$eventObj:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Everything is loaded!"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
]]></content:encoded>
			<wfw:commentRss>http://staticmethods.com/blog/archives/6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Another Flash/Development Blog:</title>
		<link>http://staticmethods.com/blog/archives/1</link>
		<comments>http://staticmethods.com/blog/archives/1#comments</comments>
		<pubDate>Tue, 29 Jan 2008 04:32:10 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Ok. So, it seems that everybody has a flash/development blog now days. I had been thinking about setting one up for a while now, but it never happened - mostly because i could think of like 100 other things i should be doing instead. Like sleeping. Or showering, maybe.
Then the other day, my friend Matt [...]]]></description>
			<content:encoded><![CDATA[<p>Ok. So, it seems that everybody has a flash/development blog now days. I had been thinking about setting one up for a while now, but it never happened - mostly because i could think of like 100 other things i should be doing instead. Like sleeping. Or showering, maybe.</p>
<p>Then the other day, my friend Matt (<a target="_blank" href="http://evolve.reintroducing.com/">he has a blog too</a>), was asking if it would be ok to distribute an ActionScript class that i had wrote, to some people that were interested. I thought, "Sure, that's fine...", and after some back and forth, he had convinced me that i finally needed to set up a blog of my own. So here it is... Thanks Matt, for getting me to set it up, and answering my wordpress-noob questions.</p>
<p>More posts to come, maybe.
</p>
]]></content:encoded>
			<wfw:commentRss>http://staticmethods.com/blog/archives/1/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

