<?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/"
	>

<channel>
	<title>a moment of your time?</title>
	<atom:link href="http://johnfn.blog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnfn.blog.com</link>
	<description></description>
	<pubDate>Tue, 19 Feb 2008 18:07:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MovieClip(root)</title>
		<link>http://johnfn.blog.com/2008/02/19/moviecliproot/</link>
		<comments>http://johnfn.blog.com/2008/02/19/moviecliproot/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 18:07:15 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[MovieClip(root).doStuffLikeNormal_rootInAS2<br />
<br />
<br />
<br />
This is what makes AS3 still programmable, but I wish they wouldn't force you to cast it to MovieClip. That's just stupid. More and more as I program with AS3 it feels like it's full of poor choices of syntax. I mean, why do you have to do that whole addEventListener every time that you want to make a simple button? I understand that they're trying to centralize code, but come on. Sometimes if its just a tiny function, it's BETTER to have it on a button isntead of clogging up the main frame.<br />
<br />
Why did they take away var on textboxes? Why did they take away eval? Meh...
]]></description>
			<content:encoded><![CDATA[<div>MovieClip(root).doStuffLikeNormal_rootInAS2</p>
<p>This is what makes AS3 still programmable, but I wish they wouldn&#8217;t force you to cast it to MovieClip. That&#8217;s just stupid. More and more as I program with AS3 it feels like it&#8217;s full of poor choices of syntax. I mean, why do you have to do that whole addEventListener every time that you want to make a simple button? I understand that they&#8217;re trying to centralize code, but come on. Sometimes if its just a tiny function, it&#8217;s BETTER to have it on a button isntead of clogging up the main frame.</p>
<p>Why did they take away var on textboxes? Why did they take away eval? Meh&#8230;
</p></div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2008/02/19/moviecliproot/feed/</wfw:commentRss>
		</item>
		<item>
		<title></title>
		<link>http://johnfn.blog.com/2008/02/04/</link>
		<comments>http://johnfn.blog.com/2008/02/04/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 18:37:31 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is just annoying me.<br />
<br />
MovieClip.prototype.bringToTop = new function(){<br />
&#160;&#160;&#160; this.parent.setChildIndex(this, this.parent.numChildren-1);<br />
}<br />
<br />
The whole "access a mc by its parent only" thing gets to me sometimes.
]]></description>
			<content:encoded><![CDATA[<div>This is just annoying me.</p>
<p>MovieClip.prototype.bringToTop = new function(){<br />
&#160;&#160;&#160; this.parent.setChildIndex(this, this.parent.numChildren-1);<br />
}</p>
<p>The whole &#8220;access a mc by its parent only&#8221; thing gets to me sometimes.
</p></div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2008/02/04/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AS3: Frame Labels</title>
		<link>http://johnfn.blog.com/2007/09/13/as3-frame-labels/</link>
		<comments>http://johnfn.blog.com/2007/09/13/as3-frame-labels/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 16:57:26 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p><font face="courier new,courier">if (mc.currentLabel == "Start")</font></p>
<p>I find this really helpful. It goes a bit more towards the ideal fully flexible Flash movie/game that can have its frames adjusted at will.</p>

]]></description>
			<content:encoded><![CDATA[<div>
<p><font face="courier new,courier">if (mc.currentLabel == &#8220;Start&#8221;)</font></p>
<p>I find this really helpful. It goes a bit more towards the ideal fully flexible Flash movie/game that can have its frames adjusted at will.</p>
</div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2007/09/13/as3-frame-labels/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Push Array</title>
		<link>http://johnfn.blog.com/2007/09/12/push-array/</link>
		<comments>http://johnfn.blog.com/2007/09/12/push-array/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 16:39:28 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[<h3>AS3: My open source "push array".</h3>
<p><font face="courier new,courier"><font face="verdana,geneva"><b>What does it do?</b> It stores things inside an array. You add to the array by going array.Push(Obj) and pop from the array by doing array.Pop(Obj).</font></font></p>
<p><font face="courier new,courier"><font face="verdana,geneva">&#160;<b>What would I use it for?</b> Lets say you have a space shooter game. Enemies are constantly flying in and out of the game. In order to hit test them properly with bullets and without (much) lag, you would create a push array and push all enemies that exist into the array. Whenever one dies or flies off screen, you pop it from the array.</font></font></p>
<p>&#160;</p>
<p><i>(This class is not optimized. I'll probably put up a faster one later that counts the number of objects in the array instead of just going straight to 200. Still, I think it might be helpful.)</i></p>
<p><font face="courier new,courier">package {<br />
&#160;&#160; &#160;import flash.filters.*;<br />
&#160;&#160; &#160;import flash.display.MovieClip;<br />
&#160;&#160; &#160;import flash.display.Sprite;<br />
&#160;&#160; &#160;import flash.display.*;<br />
&#160;&#160; &#160;import flash.events.MouseEvent;<br />
<br />
&#160;&#160; &#160;public class pushArray {<br />
&#160;&#160; &#160;&#160;&#160; &#160;var base:Array = new Array(200);<br />
&#160;&#160; &#160;&#160;&#160; &#160;function pushArray() {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[i]=undefined;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Find(obj:Object):int {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]==obj) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return i;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;break;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return -1;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Push(obj:Object):int {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]==undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;obj.index=i;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[i]=obj;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return i;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;break;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return -1;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Get(index:int):Object {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return base[index];<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function PopIndex(index:int) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[index]=undefined;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Pop(obj:Object) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]==obj) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[i]=undefined;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;break;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function getArray():Array {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var real:Array = new Array();<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var indx:int=0;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;real[indx++]=base[i];<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return real;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function len():int {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var len:int;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;len++;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return len;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}</font></p>
<p><font face="courier new,courier"><br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Hit(obj:Object):Object {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined &#38;&#38; base[i]!=obj) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (obj.hitTestObject(base[i])) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return base[i];<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return false;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}</font></p>
<p><font face="courier new,courier"><br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Trace() {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var vals:String = "";<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&#60;base.length; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;vals = vals + " " + base[i];<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;} else {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;vals = vals + " undef";<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;trace(vals);<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;}<br />
}</font></p>

]]></description>
			<content:encoded><![CDATA[<div>
<h3>AS3: My open source &#8220;push array&#8221;.</h3>
<p><font face="courier new,courier"><font face="verdana,geneva"><b>What does it do?</b> It stores things inside an array. You add to the array by going array.Push(Obj) and pop from the array by doing array.Pop(Obj).</font></font></p>
<p><font face="courier new,courier"><font face="verdana,geneva">&#160;<b>What would I use it for?</b> Lets say you have a space shooter game. Enemies are constantly flying in and out of the game. In order to hit test them properly with bullets and without (much) lag, you would create a push array and push all enemies that exist into the array. Whenever one dies or flies off screen, you pop it from the array.</font></font></p>
<p>&#160;</p>
<p><i>(This class is not optimized. I&#8217;ll probably put up a faster one later that counts the number of objects in the array instead of just going straight to 200. Still, I think it might be helpful.)</i></p>
<p><font face="courier new,courier">package {<br />
&#160;&#160; &#160;import flash.filters.*;<br />
&#160;&#160; &#160;import flash.display.MovieClip;<br />
&#160;&#160; &#160;import flash.display.Sprite;<br />
&#160;&#160; &#160;import flash.display.*;<br />
&#160;&#160; &#160;import flash.events.MouseEvent;</p>
<p>&#160;&#160; &#160;public class pushArray {<br />
&#160;&#160; &#160;&#160;&#160; &#160;var base:Array = new Array(200);<br />
&#160;&#160; &#160;&#160;&#160; &#160;function pushArray() {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[i]=undefined;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Find(obj:Object):int {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]==obj) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return i;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;break;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return -1;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Push(obj:Object):int {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]==undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;obj.index=i;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[i]=obj;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return i;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;break;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return -1;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Get(index:int):Object {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return base[index];<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function PopIndex(index:int) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[index]=undefined;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Pop(obj:Object) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]==obj) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;base[i]=undefined;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;break;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function getArray():Array {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var real:Array = new Array();<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var indx:int=0;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;real[indx++]=base[i];<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return real;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;public function len():int {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var len:int;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;len++;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return len;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}</font></p>
<p><font face="courier new,courier"><br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Hit(obj:Object):Object {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;200; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined &amp;&amp; base[i]!=obj) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (obj.hitTestObject(base[i])) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return base[i];<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return false;<br />
&#160;&#160; &#160;&#160;&#160; &#160;}</font></p>
<p><font face="courier new,courier"><br />
&#160;&#160; &#160;&#160;&#160; &#160;public function Trace() {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var vals:String = &#8220;&#8221;;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;for (var i:int=0; i&lt;base.length; i++) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (base[i]!=undefined) {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;vals = vals + &#8221; &#8221; + base[i];<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;} else {<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;vals = vals + &#8221; undef&#8221;;<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;trace(vals);<br />
&#160;&#160; &#160;&#160;&#160; &#160;}<br />
&#160;&#160; &#160;}<br />
}</font></p>
</div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2007/09/12/push-array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ridding MCs.</title>
		<link>http://johnfn.blog.com/2007/09/12/ridding-mcs/</link>
		<comments>http://johnfn.blog.com/2007/09/12/ridding-mcs/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 16:33:23 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[<h3>AS3: Getting rid of movie clips.</h3>
<p>As far as I know, there IS NO WAY. No way to perminently delete it from Flash, anyways. The best you can hope for is clearing every existing variable that references to the clip, then going removeChild(clip) and deleting all listeners that listen for the clip (because they keep an instance of the clip).</p>

]]></description>
			<content:encoded><![CDATA[<div>
<h3>AS3: Getting rid of movie clips.</h3>
<p>As far as I know, there IS NO WAY. No way to perminently delete it from Flash, anyways. The best you can hope for is clearing every existing variable that references to the clip, then going removeChild(clip) and deleting all listeners that listen for the clip (because they keep an instance of the clip).</p>
</div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2007/09/12/ridding-mcs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AS3 quips</title>
		<link>http://johnfn.blog.com/2007/09/11/as3-quips/</link>
		<comments>http://johnfn.blog.com/2007/09/11/as3-quips/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 20:10:22 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>&#160;</p>
<h2><b>AS3:</b></h2>
<p>&#160;</p>
<p><b>e.currentTarget</b></p>
<p>When you add an event listener, and then do something like this:</p>
<p><font face="courier new,courier">function listen(e:Event){</font></p>
<p><font face="courier new,courier">e.target.x+=5;</font></p>
<p><font face="courier new,courier">}</font></p>
<p>&#160;</p>
<p>That could actually screw you up. For some dumb reason e.target doesn't actually always return the target movie clip. ?!?! I don't understand you, Adobe.</p>
<p>The correct way is of course <font face="courier new,courier">e.currentTaret.x+=5;</font></p>
<p>&#160;</p>
<p><b>getChildIndex()</b></p>
<p>Weirdly enough, you cant just do</p>
<p><font face="courier new,courier">getChildIndex(e.currentTarget);</font></p>
<p>&#160;</p>
<p>You have to do... (deep breath)<br /></p>
<p><font face="courier new,courier">e.currentTarget.parent.getChildIndex(DisplayObject(e.currentTarget))</font></p>
<p>&#160;</p>
<p>&#160;</p>

]]></description>
			<content:encoded><![CDATA[<div>
<p>&#160;</p>
<h2><b>AS3:</b></h2>
<p>&#160;</p>
<p><b>e.currentTarget</b></p>
<p>When you add an event listener, and then do something like this:</p>
<p><font face="courier new,courier">function listen(e:Event){</font></p>
<p><font face="courier new,courier">e.target.x+=5;</font></p>
<p><font face="courier new,courier">}</font></p>
<p>&#160;</p>
<p>That could actually screw you up. For some dumb reason e.target doesn&#8217;t actually always return the target movie clip. ?!?! I don&#8217;t understand you, Adobe.</p>
<p>The correct way is of course <font face="courier new,courier">e.currentTaret.x+=5;</font></p>
<p>&#160;</p>
<p><b>getChildIndex()</b></p>
<p>Weirdly enough, you cant just do</p>
<p><font face="courier new,courier">getChildIndex(e.currentTarget);</font></p>
<p>&#160;</p>
<p>You have to do&#8230; (deep breath)</p>
<p><font face="courier new,courier">e.currentTarget.parent.getChildIndex(DisplayObject(e.currentTarget))</font></p>
<p>&#160;</p>
<p>&#160;</p>
</div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2007/09/11/as3-quips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I&#8217;m a cool kid</title>
		<link>http://johnfn.blog.com/2007/09/10/im-a-cool-kid/</link>
		<comments>http://johnfn.blog.com/2007/09/10/im-a-cool-kid/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 22:59:01 +0000</pubDate>
		<dc:creator>johnfn</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[<h1><font face="helvetica" size="1">I want to test out this thing cause it seems so cool. Plus, all the cool kids are doing blogs nowadays.</font></h1>

]]></description>
			<content:encoded><![CDATA[<div>
<h1><font face="helvetica" size="1">I want to test out this thing cause it seems so cool. Plus, all the cool kids are doing blogs nowadays.</font></h1>
</div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://johnfn.blog.com/2007/09/10/im-a-cool-kid/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
