<?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>plasticular inscriptor &#187; flash</title>
	<atom:link href="http://www.plasticstare.com/plains/category/technology/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.plasticstare.com/plains</link>
	<description></description>
	<lastBuildDate>Tue, 17 Aug 2010 23:57:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fix the Focus Rect for fl.controls.TextInput in AS3</title>
		<link>http://www.plasticstare.com/plains/2009/05/28/fix-the-focus-rect-for-flcontrolstextinput-in-as3/</link>
		<comments>http://www.plasticstare.com/plains/2009/05/28/fix-the-focus-rect-for-flcontrolstextinput-in-as3/#comments</comments>
		<pubDate>Thu, 28 May 2009 22:35:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash as3 component textinput]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=288</guid>
		<description><![CDATA[The AS3 components in CS4 allow for visually showing that the component is focused, using a code generated or libary asset sprite as the focusRect. This can be changed using the focusRect property or through the #setStyle method inherited by all UIComponent's. The outlying size of the focusRect can also be altered by setting the [...]]]></description>
			<content:encoded><![CDATA[<p>The AS3 components in CS4 allow for visually showing that the component is focused, using a code generated or libary asset sprite as the focusRect. This can be changed using the focusRect property or through the #setStyle method inherited by all UIComponent's. The outlying size of the focusRect can also be altered by setting the focusRectPadding style, which designates the number of pixels outside the size of the component that the focusRect sits. Unfortunately, if you are using TextInput, and likely TextArea, setting this padding to 0 results in hiding the focusRect behind the component skin (the grey outline for the TextInput). This is a result of the fact that the UIComponent#drawFocus sets the childIndex of the focusRect sprite to 0, essentially placing it behind the TextInput border. I wanted to create a subclass of TextInput for which I didn't need to reset several defaults every time I used it, so I created the class below, which also fixes the 0 padding focusRect issue.<br />
<span id="more-288"></span></p>
<pre class="brush: as3;">
package {

	import fl.controls.TextInput;
	import fl.managers.IFocusManagerComponent;

	/**
	 * Extends the TextInput component in order to set the default width and
	 * height, and sets the focusRectPadding to 0 (so the focus rectangle lies
	 * directly on top of the grey text input border skin.
	 */
	public class TextInput2 extends TextInput implements IFocusManagerComponent {

		/**
		 * @constructor
		 */
		public function TextInput2() {
			super();
			textField.width = 1;
			textField.height = 1;
			width = 64;
			height = 18;
			setStyle(&quot;focusRectPadding&quot;, 0);
		}

		/**
		 * The UIComponent class, when the component is in focus, creates the
		 * uiFocusRect and sets it at childIndex 0. Unfortunately, the text input
		 * skin is then above the focus rect, and so the focus rect disappears
		 * when the focusRectPadding is 0. This calls the parent implementation,
		 * then ensures that the focus rect is visible by changing its
		 * child index.
		 */
		override public function drawFocus(draw:Boolean):void {
			super.drawFocus(draw);

			if (uiFocusRect != null) {
				setChildIndex(uiFocusRect, numChildren - 1);
			}
		}
	}
}
</pre>
<p>UPDATE: I updated the above script to set the size of the TextField in the TextInput component to be 1x1. This also fixes the problem that the TextField is created as 100x100 pixels when it is first created (as are all dynamically generated text fields). This matters if you wish to use any customized layout (such as the Yahoo astra layout managers), and don't want to have to call drawNow() or wait a frame to finalize layout settings in a UI.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2009/05/28/fix-the-focus-rect-for-flcontrolstextinput-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Line-width on Shapes in Flash, and scale9Grid Results</title>
		<link>http://www.plasticstare.com/plains/2009/05/20/line-width-on-shapes-in-flash/</link>
		<comments>http://www.plasticstare.com/plains/2009/05/20/line-width-on-shapes-in-flash/#comments</comments>
		<pubDate>Wed, 20 May 2009 22:18:42 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[linewidth]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[scale9Grid]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=275</guid>
		<description><![CDATA[A quick note regarding something I've been meaning to post a short note about for a while, for those that might be running into problems resulting from shapes drawn in flash with an outline. I ran into this recently again, so I thought I'd post for any concerned parties out there. Regardless of whether or [...]]]></description>
			<content:encoded><![CDATA[<p>A quick note regarding something I've been meaning to post a short note about for a while, for those that might be running into problems resulting from shapes drawn in flash with an outline. I ran into this recently again, so I thought I'd post for any concerned parties out there.</p>
<p>Regardless of whether or not a shape, such as a rectangle, is drawn in Flash with a hairline border line, or a borderline of 1, the result on an unscaled shape is essentially the same. The crisp outline of the shape is drawn with a pixel width of 1. The downside of this occurs when trying to create pixel perfect UI's, and especially those using shapes with a scalenine grid assigned to them.<br />
<span id="more-275"></span><br />
Using the AS3 drawing API, you can create a rectangle that has a lineStyle with a width of 1, and some fill, which would look something like this:</p>
<pre class="brush: as3; light: true;">var sh:Shape = new Shape();
sh.graphics.lineStyle(1, 0xFF0000);
sh.graphics.beginFill(0xFF6600);
sh.graphics.drawRect(0, 0, 100, 100);
sh.graphics.endFill();
addChild(sh);
trace(&quot;Size: &quot; + sh.width + &quot; x &quot; + sh.height);</pre>
<p>The code above so draws an orange rectangle with a red border that is <em>201</em> pixels wide and <em>101</em> pixels tall. If you don't know why, the reason is because flash draws the line <em>on</em> the pixel width and height of the rectangle with a line size of 1. This makes your shape 201 x 101; thankfully, Flash <em>will</em> report the width and height correctly as 201 x 101.</p>
<p>This gets stickier if you have a shape that is used as a component skin, and has a scale9Grid applied to it. In this case you will likely be working with a component that you <em>expect</em> to take up 200x100 pixels on the stage when you tell it to be that size. However, if the skin used features "line" outlines at its borders, your component will get drawn on the stage with extra pixels. If you dig into the Flash component skins, you will notice that most of the skins use <em>fills</em> for any borders on the shapes (even 1 pixel wide borders) so that the scale9Grid enabled shapes will scale correctly to the pixel. That being said, the proper way to draw the simple skin shape in this case, programmatically, would be:</p>
<pre class="brush: as3; light: true;">
var sh2:Shape = new Shape();
sh2.graphics.beginFill(0xFF0000);
sh2.graphics.drawRect(0, 0, 200, 100);
sh2.graphics.beginFill(0xFF6600);
sh2.graphics.drawRect(1, 1, 198, 98);
sh2.graphics.endFill();
addChild(sh2);
trace(&quot;Size: &quot; + sh2.width + &quot; x &quot; + sh2.height);
</pre>
<p>Incidentally, this also often cleans up some anti-aliasing at the corners of rectangular shapes which I believe is cause by some weirdness in the way the "caps" are drawn on the shapes. (but don't quote me on that...)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2009/05/20/line-width-on-shapes-in-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;Googling&#8221; Flash</title>
		<link>http://www.plasticstare.com/plains/2008/07/01/googling-flash/</link>
		<comments>http://www.plasticstare.com/plains/2008/07/01/googling-flash/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 21:25:28 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=223</guid>
		<description><![CDATA[I have to say, this is fairly interesting news. Flash was adopted early by many web-shops wanting to give the user an "integrated media experience" that couldn't be provided by straight html sites. Since then, the tools have been developed to do site analytics of flash web applications, and flash and the flex framework have [...]]]></description>
			<content:encoded><![CDATA[<p>I have to say, this is fairly interesting news. Flash was adopted early by many web-shops wanting to give the user an "integrated media experience" that couldn't be provided by straight html sites. Since then, the tools have been developed to do site analytics of flash web applications, and flash and the flex framework have come a long way toward optimizing development work-flow. Unfortunately, one of the big things that has been missing is search, or rather search recognition; ironically, many Flash sites are really marketing driven advertising sites, yet their content has not historically been searchable through search engines such as Google. A flash site for "Product XYZ" would likely get less of a ranking on search engines than a blog entry discussing XYZ or a flickr image of someone's dog named "XYZ." Looks like Google is looking to level that playing field by now making the move to <a title="google crawls flash" href="http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html">crawl flash sites</a> as well. Should be interesting to see how this effects search, and where this takes advertising and adwords technologies and the like.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/07/01/googling-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chumby Widget 002 &#8211; Japanese Alphabet!</title>
		<link>http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/</link>
		<comments>http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 11:09:24 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[chumby]]></category>
		<category><![CDATA[hiragana]]></category>
		<category><![CDATA[japanese]]></category>
		<category><![CDATA[katakana]]></category>
		<category><![CDATA[nihongo]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/</guid>
		<description><![CDATA[Just finished up version 1.0 of the Japanese Syllabary Flash Card for the Chumby. It was approved in its version 0.1 stage last week, but unfortunately, when you update a widget, it has to be approved again for public viewing. Perhaps after the big official Chumby launch there will be different tier developer permissions, some [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/intafon/2222156175/" title="20080126120743_w810i.jpg by ⌫ uɐλɹ, on Flickr"><img src="http://farm3.static.flickr.com/2181/2222156175_1df05c45d8_m.jpg" alt="20080126120743_w810i.jpg" align="left" height="180" width="240" /></a>Just finished up version 1.0 of the Japanese Syllabary Flash Card for the Chumby. It was approved in its version 0.1 stage last week, but unfortunately, when you update a widget, it has to be approved again for public viewing. Perhaps after the big official Chumby launch there will be different tier developer permissions, some of which would allow for updating already approved widgets without further approval. I guess we shall see about that. So, I expect this one to go public again on Monday. I'll post the link for the Chumby site page for it once it is up again. In the meantime, you can view a non-configurable version on my site at  <a href="http://www.plasticstare.com/nihongo/syllabaryflashcard.html" title="Syllabary Flash Card" target="_blank">http://www.plasticstare.com/nihongo/syllabaryflashcard.html.</a> The photo is of a slightly earlier version than the current one, but it looks pretty much the same. The Chumby widget allows you to view Hiragana or Katakana (or random), allows you to choose which of the Romaji and symbol to view first, and allows you choose which character sets you wish to view (and defaults to a,i,u,e,o,ka,ki,ku,ke,ko, and ga,gi,gu,ge,go).</p>
<p>Update: the chumby widget can be found at <a href="http://www.chumby.com/guide/widget/Japanese%20Syllabary%20Flash%20Card" title="japanese syllabary flash card" target="_blank">http://www.chumby.com/guide/widget/Japanese Syllabary Flash Card</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Actionscript Interface Implementation Error</title>
		<link>http://www.plasticstare.com/plains/2006/08/30/actionscript-interface-implementation-error/</link>
		<comments>http://www.plasticstare.com/plains/2006/08/30/actionscript-interface-implementation-error/#comments</comments>
		<pubDate>Thu, 31 Aug 2006 00:01:34 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/08/30/actionscript-interface-implementation-error/</guid>
		<description><![CDATA[Just to add this to the web search realm, a quick note on a fairly annoying discrepancy in the Flash IDE. When compiling flash movies that utilize interfaces, there is the possibility of getting the following error: The implementation of the interface method doesn't match its definition. Despite the fact that MTASC has no problem [...]]]></description>
			<content:encoded><![CDATA[<p>Just to add this to the web search realm, a quick note on a fairly annoying discrepancy in the Flash IDE. When compiling flash movies that utilize interfaces, there is the possibility of getting the following error:</p>
<pre>The implementation of the interface method doesn't match its definition.</pre>
<p> Despite the fact that MTASC has no problem with it.</p>
<p><span id="more-116"></span></p>
<p>*I believe* that it is acceptable according to ECMA script standards to define functions in interfaces by supplying the <em>types</em> of the parameters, rather than the names and types. Compare:</p>
<pre>public function moo(Object, String):Void;</pre>
<p>vs:</p>
<pre>public function moo(cow:Object, foo:String):Void;</pre>
<p>The former is handled fine by MTASC; however, when compiled in the Flash IDE, the error "The implementation of the interface method doesn't match its definition." is returned for every function defined in the interface that has input parameters. The solution is to define the methods is in the latter example; however, for the Flash IDE to compile without errors, not only do the parameter types have to match, but also the parameters names have to match.</p>
<p>Hopefully that will help someone searching for this error...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/08/30/actionscript-interface-implementation-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interfacing in Actionscript</title>
		<link>http://www.plasticstare.com/plains/2006/08/25/interfacing-in-actionscript/</link>
		<comments>http://www.plasticstare.com/plains/2006/08/25/interfacing-in-actionscript/#comments</comments>
		<pubDate>Sat, 26 Aug 2006 03:02:53 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/08/25/interfacing-in-actionscript/</guid>
		<description><![CDATA[It wasn't until recently that I actually had the occasion where it made/makes a good bit of sense to use interfaces in any of my flash projects. Part of the reason has to do with formerly lacking the time to actually put together projects the right way, under crazy timelines, and part of it has [...]]]></description>
			<content:encoded><![CDATA[<p>It wasn't until recently that I actually had the occasion where it made/makes a good bit of sense to use interfaces in any of my flash projects. Part of the reason has to do with formerly lacking the time to actually put together projects the right way, under crazy timelines, and part of it has to do with the fact that I'm working on something that needs to stick around for a bit and will possibly be augmented by persons other (and including) myself.</p>
<p>In most flash projects, interfaces are a bit convoluted and require thoughtfully building out to what amounts to an extra class. Most of the time in smaller projects, subclassing "default" classes pretty much gets the job done. To backtrack slightly for those unfamiliar with the term, an interface is an abstract type which is used to designate how classes can be accessed and manipulated. To use the terminology, an <em>interface</em> specifies the interface that must be <em>implemented</em> by a set of classes.</p>
<p><span id="more-114"></span></p>
<p><strong>Utilizing Interfaces</strong></p>
<p>Interfaces in actionscript are particularly useful when creating a set of classes that all have the same methods; the interface strictly defines the guidelines that must be followed when creating a new class of this type.</p>
<p>As an example, let us suppose that we are creating a set of shape classes; we will be creating a circle class and a square class. Let us suppose for now that the only method that we want to implement is the getArea() method. Here are our classes:</p>
<div class="igBar"><span id="lactionscript-8"><a href="#" onclick="javascript:showCodeTxt('actionscript-8'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-8">
<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: #000000; font-weight: bold;">class</span> Circle <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;">&nbsp; &nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> __radius:<span style="color: #0066CC;">Number</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; &nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> __type:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"Circle"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">function</span> Circle<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getArea<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <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;">&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> * <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">pow</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.__radius, <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</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; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>
<div class="igBar"><span id="lactionscript-9"><a href="#" onclick="javascript:showCodeTxt('actionscript-9'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-9">
<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: #000000; font-weight: bold;">class</span> Square <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;">&nbsp; &nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> __side:<span style="color: #0066CC;">Number</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; &nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> __type:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"Square"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">function</span> Square<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getArea<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <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;">&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">pow</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.__side, <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</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; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>
<p>So, both <em>implement</em> the same methods here. We can define an interface for all new shapes that get created, which must all allow for the calculation of their area (note that by convention, interfaces usually begin with the letter "I"):</p>
<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showCodeTxt('actionscript-10'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<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;">interface</span> IShape <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;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">function</span> getArea<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</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>
<p>You must then go back and change your class definition line in each of the two classes to </p>
<div class="igBar"><span id="lactionscript-11"><a href="#" onclick="javascript:showCodeTxt('actionscript-11'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-11">
<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: #000000; font-weight: bold;">class</span> Circle <span style="color: #0066CC;">implements</span> IShape <span style="color: #66cc66;">&#123;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
and</p>
<div class="igBar"><span id="lactionscript-12"><a href="#" onclick="javascript:showCodeTxt('actionscript-12'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<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: #000000; font-weight: bold;">class</span> Square <span style="color: #0066CC;">implements</span> IShape <span style="color: #66cc66;">&#123;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The interface defines how we can interact with shapes. The big advantage of this when working on projects is that when using environments such as Eclipse with FDT, you can specify that something is an IShape without knowing what shape it is specifically, thereby allowing you to build more flexible projects. In addition, rather than the alternative, which would be to type them as <em>Object</em>, you have a way of typing them that works with syntax checking and code hinting, which saves you time in the long run.</p>
<p><strong>Combining Interfaces with Inheritance</strong></p>
<p>Another handy trick to help when coding is to combine the use of interfaces with inheritance. Let's suppose we want to create a Shape superclass as such:</p>
<div class="igBar"><span id="lactionscript-13"><a href="#" onclick="javascript:showCodeTxt('actionscript-13'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-13">
<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: #000000; font-weight: bold;">class</span> Shape <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #0066CC;">implements</span> IShape<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;">&nbsp; &nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> __type:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"Shape"</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; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">function</span> Shape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</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; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getArea<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">undefined</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</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; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setColor<span style="color: #66cc66;">&#40;</span>newColor:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; theColor = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Color</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</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;">&nbsp; &nbsp; &nbsp; theColor.<span style="color: #0066CC;">setRGB</span><span style="color: #66cc66;">&#40;</span>newColor<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; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <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;">&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Shape of type: "</span> + <span style="color: #0066CC;">this</span>.__type<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; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>
<p>So, our definitions would change as such:</p>
<div class="igBar"><span id="lactionscript-14"><a href="#" onclick="javascript:showCodeTxt('actionscript-14'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-14">
<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: #000000; font-weight: bold;">class</span> Square <span style="color: #0066CC;">extends</span> Shape <span style="color: #0066CC;">implements</span> IShape <span style="color: #66cc66;">&#123;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now we have a few added benefits. Our shapes are now subclassed as MovieClips and Shapes, which means that they can inherit methods from the Shape class. All of our shapes have a __type and all are now MovieClips, so all of them can inherit toString() and setColor().</p>
<p>The cool part about this is that in this case, we now can implement the IShape interface (remember, all classes that implement an interface are <em>required</em> to implement the designated methods) without declaring ones inherited from the superclass unless we choose to do so. This means that we don't have to add toString() and setColor() unless we want to override the ones in the superclass. This is really great when you have several private variables with getters and setters that you want required by the interface, but don't want to have to duplicate and comment in every single subclass.</p>
<p>Another advantage of using interfaces is that, unlike extending superclasses, classes can implement as many interfaces as you want. For example, you could have a set of Shapes that implement an IAnimation interface as well as the IShape interface. Other types of objects could also implement this same IAnimation interface, so you could call the method pulse(cycleDuration) the same way on both types of class, and your code hinting would tell you that the method pulse requires a number input. This is probably the biggest advantage -- being able to type an object as an interface when passing it to another object that wants to treat it as something that has the methods that the interface requires.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/08/25/interfacing-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Syntax Coloring/ Drawing Class</title>
		<link>http://www.plasticstare.com/plains/2006/05/31/testing-syntax-coloring-drawing-class/</link>
		<comments>http://www.plasticstare.com/plains/2006/05/31/testing-syntax-coloring-drawing-class/#comments</comments>
		<pubDate>Wed, 31 May 2006 16:08:08 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[plasticware]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=82</guid>
		<description><![CDATA[The following is a drawing class that I've used for the past year or so. I'm kind of using this article to test out various ways of doing syntax coloring in this blog. I use MoveableType, and I'm currently looking for some plug-in that will allow me to automatically publish code in the blog and [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a drawing class that I've used for the past year or so. I'm kind of using this article to test out various ways of doing syntax coloring in this blog. I use MoveableType, and I'm currently looking for some plug-in that will allow me to automatically publish code in the blog and have it look correct. Unfortunately, the only one I've found so far MTColorer, I wasn't able to get working. There are a few that my friend Mason and I have looked at for WordPress that work pretty well and (like many WordPress things) are easily configurable/hackable and free. The code that I've included below (as well as the other code so far in this blog) is colored using the Actionscript HIghlighter featured on <a href="http://www.shockwave-india.com/blog/services/as-highlight2/">Arul's Blog</a>, which allows you to paste in your code and hit a button to get the styled text. Arul's code does a great job, but you have to visit his site to style your code, and then also provide a download link to the text file of your code if you want to provide just a plain text version. But hey, it works. He notes on the site that there is the possibility of releasing the code once he cleans it up, so maybe there will be something one can post on their own site sometime soon.</p>
<p>As for the code below, it is a simple drawing class that allows you to easily draw a generic  box, a hairline box, and a filled rectangle. The main reason, however, that I created the class, is for those occasions where you may need a box that  is not filled and is not made up of flash lines. If you've used Flash enough, you know that if you draw a 3 pixel line box, the corners are often rounded looking, which doesn't fly unless that is what you want in your design. I have worked on several projects that were to use photos that needed a "frame" of a certain width. The drawing class drawFrame method basically draws 4 filled boxes to create a rectangular "frame" of a certain thickness, made entirely of "fill" rather than lines, so the corners are nice and sharp. Of the instances where I have used this class, I have used the drawFrame method 90% of the time. Enjoy.</p>
<div class="igBar"><span id="lactionscript-16"><a href="#" onclick="javascript:showCodeTxt('actionscript-16'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-16">
<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: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * &nbsp;Drawing</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: #808080; font-style: italic;"> *&nbsp; @author - Ryan Todd</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&nbsp; </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: #808080; font-style: italic;"> *&nbsp; PlasticStare PlasticWare Codebase Project (PWCB)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&nbsp; This code is part of the PlasticStare PlasticWare codebase project. This work is Copyright (c) 2005 Ryan Todd, all rights reserved.</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: #808080; font-style: italic;"> *&nbsp; Prior permission of the author is required in order to redistribute the source code or algorithms in a commercial product in any </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&nbsp; form -- original or derivative, in any programming language. The source code of the equations may be distributed as part of a </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: #808080; font-style: italic;"> *&nbsp; non-commercial product, provided that redistributions contain the copyright notice:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</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: #808080; font-style: italic;"> *&nbsp; This Code is Copyright (c) 2005 Ryan Todd, all rights reserved.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&nbsp; This work is subject to the terms in http://www.plasticstare.com/codebase_terms_of_use.html.</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: #808080; font-style: italic;"> *</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</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: #808080; font-style: italic;"> *&nbsp; AUTHOR :: Ryan Todd</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&nbsp; AUTHOR SITE :: http://www.plasticstare.com/</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: #808080; font-style: italic;"> *&nbsp; CREATED :: 2005/10/15</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</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: #808080; font-style: italic;"> *&nbsp; Drawing - this can be used to draw boxes and sometime in the future, other shapes</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</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: #808080; font-style: italic;"> *&nbsp; Version :: v.1.0.5.20051015 for Actionscript 2.0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</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;">class</span> com.<span style="color: #006600;">plasticstare</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Drawing</span><span style="color: #66cc66;">&#123;</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; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Drawing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// drawHairlineBox - draws a box at in the specified movieclip with the specified rect and color. the line</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; &nbsp; <span style="color: #808080; font-style: italic;">// of the box is of hairline thickness</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> drawHairlineBox<span style="color: #66cc66;">&#40;</span>_mc:<span style="color: #0066CC;">MovieClip</span>,_color:<span style="color: #0066CC;">String</span>, _rectArray:<span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;color:#800000;">100</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;">&nbsp; &nbsp; &nbsp; &nbsp; Drawing.<span style="color: #006600;">drawBox</span><span style="color: #66cc66;">&#40;</span>_mc,_color, _rectArray<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; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// drawBox</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> drawBox<span style="color: #66cc66;">&#40;</span>_mc:<span style="color: #0066CC;">MovieClip</span>,_color:<span style="color: #0066CC;">String</span>, _rectArray:<span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>, _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// drawFilledBox</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; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> drawFilledBox<span style="color: #66cc66;">&#40;</span>_mc:<span style="color: #0066CC;">MovieClip</span>,_color:<span style="color: #0066CC;">String</span>,<span style="color: #0066CC;">_alpha</span>:<span style="color: #0066CC;">Number</span>,_rectArray:<span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,0x000000,<span style="color: #cc66cc;color:#800000;">0</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">beginFill</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #0066CC;">_alpha</span><span style="color: #66cc66;">&#41;</span>;&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span> _rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// drawFrame - essentially draws 4 boxes inside the specified rect of the color specified. these boxes</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; &nbsp; <span style="color: #808080; font-style: italic;">// align along the inside of the top, bottom, left, and right of the rect and have the thickness (from the </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// rect border to the inner side of the box) specified</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; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> drawFrame<span style="color: #66cc66;">&#40;</span>_mc:<span style="color: #0066CC;">MovieClip</span>,_color:<span style="color: #0066CC;">String</span>, _rectArray:<span style="color: #0066CC;">Array</span>, _thickness<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> topb:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>+_thickness<span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> botb:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</span>-_thickness,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> lftb:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>+_thickness,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> rgtb:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>-_thickness,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>,_rectArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;color:#800000;">0</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>topb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,topb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; Drawing.<span style="color: #006600;">drawBox</span><span style="color: #66cc66;">&#40;</span>_mc,_color, topb<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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>botb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,botb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; Drawing.<span style="color: #006600;">drawBox</span><span style="color: #66cc66;">&#40;</span>_mc,_color, botb<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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>lftb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,lftb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; Drawing.<span style="color: #006600;">drawBox</span><span style="color: #66cc66;">&#40;</span>_mc,_color, lftb<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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>rgtb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>,rgtb<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; &nbsp; &nbsp; Drawing.<span style="color: #006600;">drawBox</span><span style="color: #66cc66;">&#40;</span>_mc,_color, rgtb<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;">&nbsp; &nbsp; &nbsp; &nbsp; _mc.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>_color<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">100</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; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/05/31/testing-syntax-coloring-drawing-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash SWF Load: OSX vs. Windows</title>
		<link>http://www.plasticstare.com/plains/2006/01/13/flash-swf-load-osx-vs-windows/</link>
		<comments>http://www.plasticstare.com/plains/2006/01/13/flash-swf-load-osx-vs-windows/#comments</comments>
		<pubDate>Fri, 13 Jan 2006 15:05:03 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=66</guid>
		<description><![CDATA[Just a quick note to mark one subtle difference between the way that the Flash player loads and initializes .swf files that have been loaded into another movie. This effects both the Flash 7 &#38; 8 players. Hopefully this will find its way into the google gaze and help some cross-platform developer out there. The [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to mark one subtle difference between the way that the Flash player loads and initializes .swf files that have been loaded into another movie. This effects both the Flash 7 &amp; 8 players. Hopefully this will find its way into the google gaze and help some cross-platform developer out there.</p>
<p>The scenario: I have been recently working on a project in which I am loading a sub-menu represented by a swf into the main flash movie. I am then dynamically assigning a sub-menu class to that new swf upon the onLoadInit call that is fired from the MovieClipLoader class.</p>
<p>The problem: once the .swf was loaded, I wanted to call the init() function that resides in the submenu class. Unfortunately, if init() was called when onLoadInit() was triggered, init() was fired before linked library items in the .swf were available.</p>
<p>Two solutions: One solution that worked was ridiculous. If I used an interval to delay the init() call for a half second (or less even), this was enough time. The other more sensible solution was to put this.init() in a frame of the timeline of the loaded .swf. This worked. My intuition said to put the this.init() call on frame 2, but it actually worked in frame 1. I develop in OSX.</p>
<p>The result: On windows machines, frame 1 was too early to have the this.init() call as well. The init call had to be moved to frame 2 in order for the symbols that were being exported in frame 1 to be available, particularly on windows machines. Frame 1 was fine for OSX.</p>
<p>I should have followed my intuition on this one. Having used Director for many years and Flash since Flash 3, I've come to distrust the fact that published Macro-dobe "movies" will actually perform properly on the first frame. Its not a huge work around, but I thought that this difference between the way the player performs in OSX and Windows (among others) was important to note.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/01/13/flash-swf-load-osx-vs-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a True MovieClip Sub-Class</title>
		<link>http://www.plasticstare.com/plains/2005/12/21/creating-a-true-movieclip-sub-class/</link>
		<comments>http://www.plasticstare.com/plains/2005/12/21/creating-a-true-movieclip-sub-class/#comments</comments>
		<pubDate>Thu, 22 Dec 2005 05:08:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=64</guid>
		<description><![CDATA[My friend Alan and I had talked about this about 6 months ago. Suppose that you want to have an AS 2.0 Class that extends MovieClip, and you would like to "instantiate" as a movieclip in some location in your flash movie. It would be great to be able to call that class in the [...]]]></description>
			<content:encoded><![CDATA[<p>My friend Alan and I had talked about this about 6 months ago. Suppose that you want to have an AS 2.0 Class that extends MovieClip, and you would like to "instantiate" as a movieclip in some location in your flash movie. It would be great to be able to call that class in the same way that you can call MovieClip.createEmptyMovieClip(), and have a new movieclip instance that is in fact, a class that extends MovieClip.</p>
<p>Originally, the way that I had been doing this was to first create a class that extends MovieClip such as this ::</p>
<div class="igBar"><span id="lactionscript-19"><a href="#" onclick="javascript:showCodeTxt('actionscript-19'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-19">
<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: #000000; font-weight: bold;">class</span> com.<span style="color: #006600;">plasticstare</span>.<span style="color: #006600;">SpaceInvader</span> <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> SpaceInvader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span><span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"All your base..."</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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>
<p>Then, I would create an empty movieclip symbol in the library of my .fla file, and give it a linkage id, and then in the linkage associate it with the AS 2.0 class of my choosing, or in this case, com.plasticstare.SpaceInvader.</p>
<p>There are a few problems with this beyond the fact that it seems a bit laborious to have to do this. When compiling code in MTASC, for example, you have to create a special little class to make sure that any .swfs that you are publishing as shared libraries actually get the newly compiled code and make a reference to it in your .fla files (or there is probably some other way to do this as well). Otherwise, if you make a change to your class for that linked symbol, you have to publish back out of the Flash IDE again. (And if you have a bunch of them, its a real pain.)</p>
<p>I stumbled upon another way of doing this today when checking out something else in the Flash LiveDocs. Someone had contributed the code below in its original form, and I've since made a couple of tweeks - one to fix a major flaw. </p>
<div class="igBar"><span id="lactionscript-20"><a href="#" onclick="javascript:showCodeTxt('actionscript-20'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-20">
<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;">public</span> <span style="color: #000000; font-weight: bold;">function</span> createExtendedMovieClip<span style="color: #66cc66;">&#40;</span>_constructor:<span style="color: #000000; font-weight: bold;">Function</span>, <span style="color: #0066CC;">_parent</span>:<span style="color: #0066CC;">MovieClip</span>, _depth:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span> <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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #0066CC;">_parent</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">_parent</span> = <span style="color: #0066CC;">_root</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!_depth<span style="color: #66cc66;">&#41;</span> <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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _depth = <span style="color: #0066CC;">_parent</span>.<span style="color: #0066CC;">getNextHighestDepth</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; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> mc:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">_parent</span>.<span style="color: #0066CC;">createEmptyMovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"clip_"</span>+_depth, _depth<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; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> = <span style="color: #000000; font-weight: bold;">new</span> _constructor<span style="color: #66cc66;">&#40;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i <span style="color: #b1b100;">in</span> obj<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mc<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = obj<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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; &nbsp; &nbsp; &nbsp; mc.<span style="color: #0066CC;">constructor</span> = _constructor;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; mc.<span style="color: #0066CC;">__proto__</span> = obj.<span style="color: #0066CC;">__proto__</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; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> mc;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>
<p>The idea would be to use this in your Main.as class or some utility class -- some class that you can reach universally. So, supposed that I have it in my Main singleton class. I would call the function this way
<pre>Main.getInstance().createExtendedMovieClip(SpaceInvader,_root);</pre>
<p> in order to create a new SpaceInvader clip in the _root. _constructor is simply the name of the class that you want to instantiate, and _parent and _depth are the clip you want it to reside in and at what depth. (the latter 2 parameters as you see are optional) Using this code, you can just create any new Class that extends MovieClip and instantiate it as a MovieClip instance on the stage on the fly, without creating any special linked symbols in the library.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/12/21/creating-a-true-movieclip-sub-class/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FDT and the Class Template</title>
		<link>http://www.plasticstare.com/plains/2005/12/14/fdt-and-the-class-template/</link>
		<comments>http://www.plasticstare.com/plains/2005/12/14/fdt-and-the-class-template/#comments</comments>
		<pubDate>Wed, 14 Dec 2005 20:45:53 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=62</guid>
		<description><![CDATA[There seems to be a problem with the Class creation wizard in the FDT plug-in for Eclipse. If you change the Class template using the Eclipse template editor, the changes do not go into effect for Wizard. That is to say, if you create a class using the FDT Class wizard, the template changes do [...]]]></description>
			<content:encoded><![CDATA[<p>There seems to be a problem with the Class creation wizard in the FDT plug-in for Eclipse. If you change the Class template using the Eclipse template editor, the changes do not go into effect for Wizard. That is to say, if you create a class using the FDT Class wizard, the template changes do not carry over; if you open an empty class file, however, and use the content assist, the new class code block that is inserted is whatever you change it to in the template editor. To get around this, do the following.</p>
<p>First, change the template to what you want it to be in the template editor. Then, copy everything except for the last 2 lines (which should be something like:</p>
<p>class ${enclosing_package_and_type} ${cursor}{<br />
}</p>
<p>(To get to the editor, go to preferences/FDT/Editor/Templates) Now, go into your eclipse/plugins/com.pf.fdt_1.0.4/templates folder.</p>
<p>Open the file code codeTemplates.xml, and in the typecomment node, paste the text that you copied into the node value where it should currently say :: </p>
<p>/**<br />
* @author ${user}<br />
*/ </p>
<p>I replaced it with the code (for example):: </p>
<p>/**<br />
*	${enclosing_type}<br />
*	@author - Ryan Todd<br />
*<br />
* AUTHOR :: Ryan Todd<br />
* AUTHOR SITE :: http://www.plasticstare.com/<br />
* CREATED :: ${date}<br />
* DESCRIPTION ::<br />
*<br />
*/ </p>
<p>The @author is in there for the javadocs, and the ${date} is nice for inserting the creation date... </p>
<p>Now save codeTemplates.xml, quit and restart Eclipse. I'm not sure it this messes anything else up, but this is what I had to do in order to make the template I wanted to show up when creating a new class through the class creation wizard. </p>
<p>On the other hand, if you do change the class template and create a new class, like I said above, you can delete the inserted code and then use the code completion to insert the new class code and it will insert the template text that you put in using the template editor (which changes that text in the templates.xml file). </p>
<p>As an added note, you can also set FDT to overwrite the default ${user} variable in your templates in the FDT templates preference panel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/12/14/fdt-and-the-class-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash/Eclipse/ASDT Empty Class Template</title>
		<link>http://www.plasticstare.com/plains/2005/11/23/flasheclipseasdt-empty-class-template/</link>
		<comments>http://www.plasticstare.com/plains/2005/11/23/flasheclipseasdt-empty-class-template/#comments</comments>
		<pubDate>Wed, 23 Nov 2005 23:14:39 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=59</guid>
		<description><![CDATA[If you use Eclipse with MTASC and ASDT for working on your actionscript 2.0 classes, one of the handy little features is the ability to create a new class using the ASDT actionscript class creator. However, as you've found out, it sticks in that standard little author tag at the top of your new class. [...]]]></description>
			<content:encoded><![CDATA[<p>If you use Eclipse with MTASC and ASDT for working on your actionscript 2.0 classes, one of the handy little features is the ability to create a new class using the ASDT actionscript class creator. However, as you've found out, it sticks in that standard little author tag at the top of your new class. Its not rocket science, but changing this is not completely obvious from the "expert user" style Eclipse interface (read: "not the most usable interface in the world"). In order to create your own standard header for new actionscript classes, you can do the following:</p>
<ul>
<li>In Eclipse, choose File-Preferences</li>
<li>Next, in the prefs window, select ActionScript 2</li>
<li>Open the Editor sub menu, and choose Templates</li>
<li>The first template should be "class" - select it.</li>
<li>Click the edit button on the right.</li>
</ul>
<p>You can now edit your header template for all new class files. I took out "${user}" first, because my user short name on my powerbook is not the author name I wanted to use in my project classes. The "Insert Variable" button is pretty handy as well, as it allows you to choose from a variety of things to add into the template, including the current date and time. This is also handy for adding in any sort of licensing information you might want to throw in there.</p>
<p>After editing, hit the "OK" button and then the "Apply" button in the prefs window, and you should be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/11/23/flasheclipseasdt-empty-class-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SteelePlus.com Site Launch</title>
		<link>http://www.plasticstare.com/plains/2005/11/04/steelepluscom-site-launch/</link>
		<comments>http://www.plasticstare.com/plains/2005/11/04/steelepluscom-site-launch/#comments</comments>
		<pubDate>Sat, 05 Nov 2005 00:09:28 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=52</guid>
		<description><![CDATA[Phase 1 of the www.SteelePlus.com site launched today. SteelePlus is a local advertising firm that wanted an experimental/exploratory site that allowed for information about the company as well as an interactive portfolio that features the ability to spotlight pieces of work specifically, as well as group them with a particular case study. The emphasis was [...]]]></description>
			<content:encoded><![CDATA[<p>Phase 1 of the <a href="http://www.steeleplus.com">www.SteelePlus.com</a> site launched today. SteelePlus is a local advertising firm that wanted an experimental/exploratory site that allowed for information about the company as well as an interactive portfolio that features the ability to spotlight pieces of work specifically, as well as group them with a particular case study. The emphasis was on exploration with a more conventional navigation system included. I have created a few custom classes of note, including the menu, an AS 2.0 sound manager, window manager, an animation class, and a TextField.ASFunction delegate (which enables the assigning of functions to textField's to handle imported html data that contains "ASFunction:function,params" style href syntax for driving internal actionscript functions -- which incidentally is similar to a class that will be built-in for AS3 from what I read). On the back-end, Phase 1 incorporates XML and CSS files for content and layout description in the flash application, as well as custom WordPress PHP scripts for handling the "news" section of the site, and a PHP mailer for handling the ability to send "favorites" from the site to a friend (which are also stored as flash "prefs" on the users computer.</p>
<p>Phase 2 will be launching later this month, which will introduce a flash-based "community" that is built on top of a customized phpBB bulletin board system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/11/04/steelepluscom-site-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating [World] Maps in/for Flash</title>
		<link>http://www.plasticstare.com/plains/2005/11/02/creating-world-maps-infor-flash/</link>
		<comments>http://www.plasticstare.com/plains/2005/11/02/creating-world-maps-infor-flash/#comments</comments>
		<pubDate>Wed, 02 Nov 2005 18:54:47 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=51</guid>
		<description><![CDATA[I have worked on too many projects that require the use of a world map in flash (and I say this because its always difficult to find a good one to use that isn't terribly expensive). However, if you are willing to do a little work, you can generate some outlines or shapes based on [...]]]></description>
			<content:encoded><![CDATA[<p>I have worked on too many projects that require the use of a world map in flash (and I say this because its always difficult to find a good one to use that isn't terribly expensive). However, if you are willing to do a little work, you can generate some outlines or shapes based on PDF world maps, such as the ones found at <a href="http://www.lib.utexas.edu/maps/">http://www.lib.utexas.edu/maps/</a>. With a little persistance you can get some really nice maps this way. However, I would recommend making any change to the maps that you want to make in Illustrator first. For example, to remove all text from a map, do the following:
<ul>
<li>Open the map in Illustrator</li>
<li>Find and select an example of text you want to remove</li>
<li>Choose Select :: Same :: Fill and Stroke</li>
<li>Delete selected</li>
<li>Now Choose File :: Save for Web...</li>
<li>Select your save settings (.swf) and save</li>
<li>Now import into your Flash movie</li>
</ul>
<p>Of course, its not quite that simple -- there is always a bunch of other lines and artifacts that end up in there so you have to be patient, and selecting all those outlines in Flash can be painful (which is why I recommend clearing out everything you don't want in Illustrator first. Once you get the map into flash, you can then make adjustments to the fills, lines, and optimize the curves more. Once again I stress - be patient...and you shall be rewarded...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/11/02/creating-world-maps-infor-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creative Commons</title>
		<link>http://www.plasticstare.com/plains/2005/10/26/creative-commons/</link>
		<comments>http://www.plasticstare.com/plains/2005/10/26/creative-commons/#comments</comments>
		<pubDate>Thu, 27 Oct 2005 06:08:11 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=49</guid>
		<description><![CDATA[I've been building a little library of code, some of which I am going to post to the site when I get my ____ together, and was looking at the Creative Commons site (http://creativecommons.org/) to set up a license to distribute some of this code, when I came across a Mike Chambers blog entry detailing [...]]]></description>
			<content:encoded><![CDATA[<p>I've been building a little library of code, some of which I am going to post to the site when I get my ____ together, and was looking at the Creative Commons site (<a href="http://creativecommons.org/">http://creativecommons.org/</a>) to set up a license to distribute some of this code, when I came across a Mike Chambers <a href="http://weblogs.macromedia.com/mesh/archives/2005/04/adding_a_view_s.cfm">blog entry</a> detailing a way to include both a license link and a src code link from the right-click flash menu. Its a nice little code bundle for use with tutorial and open-source code distribution, which hopefully I'll have time to integrate sometime soon. Meanwhile, just working on project work and tomorrow will be building a playground with the Joe Gibbs NASCAR team (whoever that is...).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/10/26/creative-commons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCE Redskins Application</title>
		<link>http://www.plasticstare.com/plains/2005/10/19/mce-redskins-application/</link>
		<comments>http://www.plasticstare.com/plains/2005/10/19/mce-redskins-application/#comments</comments>
		<pubDate>Thu, 20 Oct 2005 06:59:05 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=47</guid>
		<description><![CDATA[This little blog was down during the end of the fray, so I forgot to mention this on the site. I haven't yet updated my portfolio site, so I'll just have to mention the application that I worked on that occupied most of my summer. I worked with a local company to produce a Windows [...]]]></description>
			<content:encoded><![CDATA[<p>This little blog was down during the end of the fray, so I forgot to mention this on the site. I haven't yet updated my portfolio site, so I'll just have to mention the application that I worked on that occupied most of my summer. I worked with a local company to produce a Windows Media Center Edition application for the Washington Redskins, that uses a flash application (which I built) as the client interface. Due to shipping configuration constraints, the application was built using actionscript 1.0, but still pulls data from the Redskins servers, featuring streaming video, game recording capability, and lots of in depth player, coach, and cheerleader bio information. The application serves also as a portal for exclusive on-demand Redskins programming. Alienware is now shipping special machines that are branded for the Washington Redskins and come preloaded with the Ultimate Redskins Fan XPerience. Go to the <a href="http://www.alienware.com/product_detail_pages/Aurora_7500_rdskn/aurora_7500_rdskn_features.aspx">Alienware</a> website for more information (and also to see the demo). On a note related to the first sentence in this post, I just took the time to update to MovableType 3(.2) and will hopefully have time soon to begin overhauling the _root site proper as well (just been too busy). Phase 1 of my most current project should be launching tomorrow or the next day...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/10/19/mce-redskins-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ignoreWhite and condenseWhite</title>
		<link>http://www.plasticstare.com/plains/2005/10/13/ignorewhite-and-condensewhite/</link>
		<comments>http://www.plasticstare.com/plains/2005/10/13/ignorewhite-and-condensewhite/#comments</comments>
		<pubDate>Fri, 14 Oct 2005 06:50:38 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=45</guid>
		<description><![CDATA[Since most of my time programming has been spent doing games and more complex programmatic gamey type interfaces, I've missed out on using some of Flash's more advanced (or not so advanced) text formatting features - until recently. I have always used the ignoreWhite property for imported XML objects, which basically tells the parser that [...]]]></description>
			<content:encoded><![CDATA[<p>Since most of my time programming has been spent doing games and more complex programmatic gamey type interfaces, I've missed out on using some of Flash's more advanced (or not so advanced) text formatting features - until recently. I have always used the ignoreWhite property for imported XML objects, which basically tells the parser that the stuff between XML nodes is not actually node content, but it wasn't until today that I stumbled on the textField <em>condenseWhite</em> property. I felt both relieved and exasperated. For several years now I have cursed the fact that any stray carriage returns in your imported XML file with text content (that is, the content inside the node or nodeValue) would show up in the text field that you dump the nodeValue content into. However, little did I know that sitting there for quite some time now was condenseWhite, which basically tells the textField to ignore those stray spaces and carriage returns and only use the formatting data provided either by html tags or by xhtml-ish tags with an imported style sheet (which I've also had the pleasure of using in a project for the first time). So, in short - textField.condenseWhite is my new best code friend. Well, at least for the day...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/10/13/ignorewhite-and-condensewhite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class Binding in AS 2.0</title>
		<link>http://www.plasticstare.com/plains/2005/10/10/class-binding-in-as-20/</link>
		<comments>http://www.plasticstare.com/plains/2005/10/10/class-binding-in-as-20/#comments</comments>
		<pubDate>Mon, 10 Oct 2005 23:34:50 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=44</guid>
		<description><![CDATA[So for those of you/us that have been using Actionscript 2.0 and building projects that have gotten a bit sizable, there's a handy little trick that I thought had been forfeited somehow when AS 2.0 came along. I'm referring to the ability to use registerClass to assign an actionscript class to a movieclip symbol being [...]]]></description>
			<content:encoded><![CDATA[<p>So for those of you/us that have been using Actionscript 2.0 and building projects that have gotten a bit sizable, there's a handy little trick that I thought had been forfeited somehow when AS 2.0 came along. I'm referring to the ability to use registerClass to assign an actionscript class to a movieclip symbol being exported with a linkage id. </p>
<p>Using the example below, you can see that the trick is to include a private static variable in your class file that assigns that particular class ("InjectionMold" below) to the movieclip symbol ("ExportedSymbol" below) to which you would like it linked. This assigns the class for you at runtime. </p>
<div class="igBar"><span id="lactionscript-22"><a href="#" onclick="javascript:showCodeTxt('actionscript-22'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-22">
<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: #000000; font-weight: bold;">class</span> com.<span style="color: #006600;">plasticstare</span>.<span style="color: #006600;">InjectionMold</span> <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <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;">&nbsp; &nbsp; &nbsp; &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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// BINDING</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> binding=</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; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">Object</span>.<span style="color: #0066CC;">registerClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"IMExportedSymbol"</span>,InjectionMold<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;">&nbsp; &nbsp; &nbsp; &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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> InjectionMold<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// whatever here</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; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>
<p>The BIG advantage, however, is this -- if you have attached the code class to the symbol in the library, every time you change the code, you have to re-export the movie from the Flash IDE in order to compile the code. If you have jumped on the open source band-wagon and are using Eclipse with MTASC, you can in this way edit the file in Eclipse and use your favorite method of re-compiling through MTASC to re-"publish" the movie. My development machine is a 1gHz 12" Powerbook (I'm working on a tutorial for using Eclipse and MTASC with OSX - its not quite day in the park to set it up, but it works great once you're there), so re-publishing from the Flash IDE can be excruciatingly slow sometimes; re-compiling using MTASC is supposedly 1000 times faster, so you can imagine the time saved during the course of a project (its almost like dividing by zero).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/10/10/class-binding-in-as-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash 8 Gadfly(s)</title>
		<link>http://www.plasticstare.com/plains/2005/10/04/flash-8-gadflys/</link>
		<comments>http://www.plasticstare.com/plains/2005/10/04/flash-8-gadflys/#comments</comments>
		<pubDate>Wed, 05 Oct 2005 03:34:40 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=41</guid>
		<description><![CDATA[I have begun to loath a particular discrepancy in the Flash 8 IDE (on OSX at least) that is particularly nasty if you are developing components that contain pixel fonts. For organizational purposes, when I develop, I like to build the pieces and not worry about sticking them on a new layer and then when [...]]]></description>
			<content:encoded><![CDATA[<p>I have begun to loath a particular discrepancy in the Flash 8 IDE (on OSX at least) that is particularly nasty if you are developing components that contain pixel fonts. For organizational purposes, when I develop, I like to build the pieces and not worry about sticking them on a new layer and then when I come to a stopping point, use the handy shift-command-d distribute to layers command (which also names every layer the name of the clip on it). Unfortunately, Flash 8 likes to take everything and move it a half pixel in some direction or another, thereby blurring your pixel font and forcing you to reposition them again to the .0 pixel.</p>
<p>Another little wierdness has to do with the output window (which I have all but abandoned at this point). If you assign mouse handlers to clips and send a trace to the output window, it gives focus to the output window, thereby forcing you to click twice on anything on the app before the mouse click will register.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/10/04/flash-8-gadflys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS 1.0 MovieClip Extensions</title>
		<link>http://www.plasticstare.com/plains/2005/03/18/as-10-movieclip-extensions/</link>
		<comments>http://www.plasticstare.com/plains/2005/03/18/as-10-movieclip-extensions/#comments</comments>
		<pubDate>Sat, 19 Mar 2005 05:48:59 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[plasticware]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains_wp/?p=33</guid>
		<description><![CDATA[I decided to re-release this list of prototype functions for actionscript 1.0 that augment the feature set of the MovieClip class. To use, simply add #include "as/MovieClipExtensions.as" (if you are keeping the ".as' files in a directory called "as") to the actionscript on frame 1 of your movie. They are a bit rough and not [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to re-release this list of prototype functions for actionscript 1.0 that augment the feature set of the MovieClip class. To use, simply add #include "as/MovieClipExtensions.as" (if you are keeping the ".as' files in a directory called "as") to the actionscript on frame 1 of your movie. They are a bit rough and not so commented, but they work none-the-less. I have since replaced/updated them with newer AS 2.0 classes and methods. Notable methods included are ::</p>
<ul>
<li>MovieClip.prototype.setPos :: handy for setting the position to an x,y coordinate</li>
<li>MovieClip.prototype.hideMe</li>
<li>MovieClip.prototype.showMe</li>
<li>MovieClip.prototype.loadWithFade :: for loading jpgs and fading them in</li>
<li>MovieClip.prototype.crossFadeTo :: for crossfading clips</li>
<li>MovieClip.prototype.roundCoords :: for use with pixel fonts - rounds to nearest integer coords</li>
<li>MovieClip.prototype.linearAnimate :: for doing linear animations of clip properties</li>
</ul>
<p>Version 1.5</p>
<p>Download :: <a href="http://www.plasticstare.com/plasticware/actionscript/as1/movieClipExtensions.zip"> movieClipExtensions.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2005/03/18/as-10-movieclip-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
