<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Summit Projects Flash Blog</title>
	<atom:link href="http://summitprojectsflashblog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://summitprojectsflashblog.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 00:40:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='summitprojectsflashblog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Summit Projects Flash Blog</title>
		<link>http://summitprojectsflashblog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://summitprojectsflashblog.wordpress.com/osd.xml" title="Summit Projects Flash Blog" />
	<atom:link rel='hub' href='http://summitprojectsflashblog.wordpress.com/?pushpress=hub'/>
		<item>
		<title>JSFL: Filter-to-ActionScript Update &#8211; Now With Color Adjustment Filter Support</title>
		<link>http://summitprojectsflashblog.wordpress.com/2011/05/31/jsfl-filter-to-actionscript-update-now-with-color-adjustment-filter-support/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2011/05/31/jsfl-filter-to-actionscript-update-now-with-color-adjustment-filter-support/#comments</comments>
		<pubDate>Tue, 31 May 2011 23:30:12 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=955</guid>
		<description><![CDATA[Figured I may as well take care of that other caveat from the original post. I need to publicly state that I simply translated this code from Grant Skinner&#8217;s ActionScript 2 ColorMatrix class. It is with Grant&#8217;s kind permission that I can post this for anyone else to use. This took a while to complete, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=955&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Figured I may as well take care of that other caveat from the <a href="http://summitprojectsflashblog.wordpress.com/2011/03/08/jsfl-translate-your-flash-professional-on-stage-filters-to-actionscript/">original post</a>.  I need to publicly state that I simply translated this code from <a href="http://gskinner.com/blog/archives/2005/09/flash_8_source_.html">Grant Skinner&#8217;s ActionScript 2 ColorMatrix class</a>.  It is with Grant&#8217;s kind permission that I can post this for anyone else to use.</p>
<p>This took a while to complete, and I apologize for being MIA recently.  The work of this script didn&#8217;t take very long at all, but gathering my wits to blog about it just kept taking a backseat.  We&#8217;ve been rather busy, and hopefully we&#8217;ll have some cool new things to share soon.</p>
<p>At any rate, a complete code listing is available <a href="http://www.summitprojects.com/resources/download/Convert%20Filters%20to%20ActionScript.jsfl">here</a>, and below:</p>
<pre><code>

function ColorMatrix(m) {

	this._matrix = m?m.concat():ColorMatrix.IDENTITY_MATRIX.concat();

	/**
	 * Copies the supplied matrix to the internal matrix.
	 * @param	m	Array
	**/
	this.copyMatrix = function(m) {
		this._matrix = m.concat();
	}
	/**
	 * Ensures that the supplied matrix Array is of the correct length.  It slices off extraneous elements, or
	 * fills in missing elements with IDENTITY elements.
	 * @param	m	Array
	 * @return	Fixed Array
	**/
	this.fixMatrix = function(m) {
		if (m.length &lt; ColorMatrix.LENGTH) {
			m = m.slice(0, m.length).concat(ColorMatrix.IDENTITY_MATRIX.slice(m.length,ColorMatrix.LENGTH));
		} else if (m.length &gt; ColorMatrix.LENGTH) {
			m = m.slice(0, ColorMatrix.LENGTH);
		}
		return m;
	}

	/**
	 * Makes sure the incoming value in between a negative and positive limit value.
	 * @param	val		The value to clean
	 * @param	limit	The absolute value of the range.  If the limit is 100, then the value is ensured to be between -100 and 100.
	 * @return	Number; the cleaned value.
	**/
	this.cleanValue = function(val, limit) {
		return Math.min(limit, Math.max(-limit, val));
	}

	/**
	 * Core function for translating color adjustments to matrix arrays.  The internal matrix is affected.
	 * @param	m	Array
	**/
	this.multiplyMatrix = function(m) {
		var col = [];

		for (var i=0; i&lt;5; i++) {
			for (j=0; j&lt;5; j++) {
				col[j] = this._matrix[j+i*5];
			}
			for (var j=0; j&lt;5; j++) {
				var val=0;
				for (var k=0; k&lt;5; k++) {
					val += m[j+k*5]*col[k];
				}
				this._matrix[j+i*5] = val;
			}
		}
	}

	/**
	 * Adjusts the internal matrix array to reflect a brightness adjustment.
	 * @param	val		The brightness, from -100 to 100.
	**/
	this.adjustBrightness = function(val) {
		val = this.cleanValue(val,100);
		if (val == 0 || isNaN(val)) { return; }
		this.multiplyMatrix([
			1,0,0,0,val,
			0,1,0,0,val,
			0,0,1,0,val,
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * @param	val	The Contrast, from -100 to 100
	**/
	this.adjustContrast = function(val) {
		val = this.cleanValue(val,100);
		if (val == 0 || isNaN(val)) { return; }
		var x;
		if (val &lt; 0) {
			x = 127 + (val / 100) * 127
		} else {
			x = val % 1;
			if (x == 0) {
				x = ColorMatrix.DELTA_INDEX[val];
			} else {
				//x = ColorMatrix.DELTA_INDEX[(val&lt;&lt;0)]; // this is how the IDE does it.
				x = ColorMatrix.DELTA_INDEX[(val&lt;&lt;0)]*(1-x)+ColorMatrix.DELTA_INDEX[(val&lt;&lt;0)+1]*x; // use linear interpolation for more granularity.
			}
			x = x*127+127;
		}
		this.multiplyMatrix([
			x/127,0,0,0,0.5*(127-x),
			0,x/127,0,0,0.5*(127-x),
			0,0,x/127,0,0.5*(127-x),
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * @param	val	The Saturation, from -100 to 100
	**/
	this.adjustSaturation = function(val) {
		val = this.cleanValue(val,100);
		if (val == 0 || isNaN(val)) { return; }
		var x    = 1+((val &gt; 0) ? 3*val/100 : val/100);
		var lumR = 0.3086;
		var lumG = 0.6094;
		var lumB = 0.0820;
		this.multiplyMatrix([
			lumR*(1-x)+x,lumG*(1-x),lumB*(1-x),0,0,
			lumR*(1-x),lumG*(1-x)+x,lumB*(1-x),0,0,
			lumR*(1-x),lumG*(1-x),lumB*(1-x)+x,0,0,
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * @param	val	The Hue, from -180 to 180
	**/
	this.adjustHue = function(val) {
		val = this.cleanValue(val,180)/180*Math.PI;
		if (val == 0 || isNaN(val)) { return; }
		var cosVal = Math.cos(val);
		var sinVal = Math.sin(val);
		var lumR = 0.213;
		var lumG = 0.715;
		var lumB = 0.072;
		this.multiplyMatrix([
			lumR+cosVal*(1-lumR)+sinVal*(-lumR),lumG+cosVal*(-lumG)+sinVal*(-lumG),lumB+cosVal*(-lumB)+sinVal*(1-lumB),0,0,
			lumR+cosVal*(-lumR)+sinVal*(0.143),lumG+cosVal*(1-lumG)+sinVal*(0.140),lumB+cosVal*(-lumB)+sinVal*(-0.283),0,0,
			lumR+cosVal*(-lumR)+sinVal*(-(1-lumR)),lumG+cosVal*(-lumG)+sinVal*(lumG),lumB+cosVal*(1-lumB)+sinVal*(lumB),0,0,
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * Adjust all four properties at once
	 * @param	brightness (-100 - 100)
	 * @param	contrast (-100 - 100)
	 * @param	saturation (-100 - 100)
	 * @param	hue (-180 - 180)
	**/
	this.adjustColor = function(brightness, contrast, saturation, hue) {
		this.adjustHue(hue);
		this.adjustContrast(contrast);
		this.adjustBrightness(brightness);
		this.adjustSaturation(saturation);
	}

	this.__defineGetter__(&quot;matrix&quot;, function() {return this._matrix.concat(); });
	this.toString = function() {
		//return &quot;ColorMatrix: &quot; + this._matrix.toString();
		var out = &quot;ColorMatrix:\n&quot;;
		var v;
		var iLen = this._matrix.length;
		var l = 4;
		for (var i = 0; i &lt; iLen; i++) {
			v = this._matrix[i].toString();
			if (v.length &gt; l) {
				v = v.substr(0, l);
			} else {
				while (v.length &lt; l) {
					v += &quot; &quot;;
				}
			}
			out += v;
			if (i % 5 == 4) {
				out += &quot;\n&quot;;
			} else {
				out += &quot; &quot;;
			}
		}
		return out;
	}

}

ColorMatrix._DELTA_INDEX = [
	0,    0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1,  0.11,
	0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.20, 0.21, 0.22, 0.24,
	0.25, 0.27, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42,
	0.44, 0.46, 0.48, 0.5,  0.53, 0.56, 0.59, 0.62, 0.65, 0.68,
	0.71, 0.74, 0.77, 0.80, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98,
	1.0,  1.06, 1.12, 1.18, 1.24, 1.30, 1.36, 1.42, 1.48, 1.54,
	1.60, 1.66, 1.72, 1.78, 1.84, 1.90, 1.96, 2.0,  2.12, 2.25,
	2.37, 2.50, 2.62, 2.75, 2.87, 3.0,  3.2,  3.4,  3.6,  3.8,
	4.0,  4.3,  4.7,  4.9,  5.0,  5.5,  6.0,  6.5,  6.8,  7.0,
	7.3,  7.5,  7.8,  8.0,  8.4,  8.7,  9.0,  9.4,  9.6,  9.8,
	10.0
];
ColorMatrix._IDENTITY_MATRIX = [
	1,0,0,0,0,
	0,1,0,0,0,
	0,0,1,0,0,
	0,0,0,1,0,
	0,0,0,0,1
]
ColorMatrix._LENGTH = ColorMatrix._IDENTITY_MATRIX.length;

ColorMatrix.__defineGetter__(&quot;DELTA_INDEX&quot;,     function() { return ColorMatrix._DELTA_INDEX; } );
ColorMatrix.__defineGetter__(&quot;IDENTITY_MATRIX&quot;, function() { return ColorMatrix._IDENTITY_MATRIX; } );
ColorMatrix.__defineGetter__(&quot;LENGTH&quot;,          function() { return ColorMatrix._LENGTH; } );

var sel = fl.getDocumentDOM().selection;
fl.outputPanel.clear();

var iLen = sel.length;
var qualities = {
	low:1,
	medium:2,
	high:3
}
for (var i = 0; i &lt; iLen; i++) {
	var s = sel[i];
	if (s.instanceType != &quot;symbol&quot;) continue;
	// fl.trace(&quot;FILTERS FOR &quot; + (s.name == &quot;&quot; ? &quot;UNNAMED INSTANCE&quot; : s.name) + &quot; -------------------------------------&quot;);
	var filters = s.filters;
	var jLen = filters.length;
	for (var j = 0; j &lt; jLen; j++) {
		var f = filters[j];

		// for (var p in f) {
		// 	fl.trace(p + &quot; :: &quot; + f[p]);
		// }

		var en = f.enabled ? &quot;&quot; : &quot;//&quot;;
		var q = qualities[f.quality];
		if (f.color) {
			var colorInfo = getColorAndAlpha(f.color);
		}
		if (f.highlightColor) {
			var highlightColorInfo = getColorAndAlpha(f.highlightColor);
		}
		if (f.shadowColor) {
			var shadowColorInfo = getColorAndAlpha(f.shadowColor);
		}
		if (f.colorArray) {
			var colorArray = [];
			var alphaArray = [];
			var iLen = f.colorArray.length;
			for (var i = 0; i &lt; iLen; i++) {
				var info = getColorAndAlpha(f.colorArray[i]);
				colorArray.push(info.color);
				alphaArray.push (info.alpha);
			}
		}
		var s = f.strength / 100;

		switch (f.name) {
			case &quot;glowFilter&quot;:
				fl.trace(en + &quot;new GlowFilter(&quot;+colorInfo.color+&quot;, &quot;+colorInfo.alpha+&quot;, &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+s+&quot;, &quot;+q+&quot;, &quot;+f.inner+&quot;, &quot;+f.knockout+&quot;);&quot;);
				break;
			case &quot;dropShadowFilter&quot;:
				fl.trace(en + &quot;new DropShadowFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, &quot;+colorInfo.color+&quot;, &quot;+colorInfo.alpha+&quot;, &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+s+&quot;, &quot;+q+&quot;, &quot;+f.inner+&quot;, &quot;+f.knockout+&quot;, &quot;+f.hideObject+&quot;);&quot;);
				break;
			case &quot;blurFilter&quot;:
				fl.trace(en + &quot;new BlurFilter(&quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+q+&quot;);&quot;);
				break;
			case &quot;bevelFilter&quot;:
				fl.trace(en + &quot;new BevelFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, &quot;+highlightColorInfo.color+&quot;, &quot;+highlightColorInfo.alpha+&quot;, &quot;+shadowColorInfo.color+&quot;, &quot;+shadowColorInfo.alpha+&quot;, &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+f.strength+&quot;, &quot;+q+&quot;, \&quot;&quot;+f.type+&quot;\&quot;, &quot;+f.knockout+&quot;);&quot;);
				break;
			case &quot;gradientBevelFilter&quot;:
				fl.trace(en + &quot;new GradientBevelFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, [&quot;+colorArray+&quot;], [&quot;+alphaArray+&quot;], [&quot;+f.posArray+&quot;], &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+f.strength+&quot;, &quot;+q+&quot;, \&quot;&quot;+f.type+&quot;\&quot;, &quot;+f.knockout+&quot;);&quot;);
				break;
			case &quot;gradientGlowFilter&quot;:
				fl.trace(en + &quot;new GradientGlowFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, [&quot;+colorArray+&quot;], [&quot;+alphaArray+&quot;], [&quot;+f.posArray+&quot;], &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+f.strength+&quot;, &quot;+q+&quot;, \&quot;&quot;+f.type+&quot;\&quot;, &quot;+f.knockout+&quot;);&quot;);
				break;
			case &quot;adjustColorFilter&quot;:
				var m = new ColorMatrix();
				m.adjustColor(f.brightness, f.contrast, f.saturation, f.hue);
				fl.trace(en + &quot;new ColorMatrixFilter([&quot;+m.matrix+&quot;]);&quot;);
				break;
		}

	}
	fl.trace(&quot;\n&quot;);
}

/**
 * Returns an Object with two properties, color and alpha, as strings, based on the parsing of the color string coming in.  The color string
 * will be something like &quot;#FF9933&quot; or &quot;#FF993366&quot;.  If it&#x27;s a 32-bit color, the alpha channel is contained in the last two bytes
 * (66 in this case).
**/
function getColorAndAlpha(color) {
	var colorInfo = {};
	if (color.length == 9) {
		colorInfo.alpha = Math.round(parseInt(color.substr(7, 2), 16) / 0xFF * 100) / 100;
		colorInfo.color = color.substr(0, 7).replace(/^#/, &quot;0x&quot;)
	} else if (color.length == 7) {
		colorInfo.alpha = 1;
		colorInfo.color = color.replace(/^#/, &quot;0x&quot;)
	} else {
		fl.trace(&quot;Problem parsing color.&quot;)
	}
	return colorInfo;
}

</code></pre>
<p>Thank you, Grant, for doing all of the hard work on this one!</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/955/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=955&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2011/05/31/jsfl-filter-to-actionscript-update-now-with-color-adjustment-filter-support/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Getting the Alpha of a Color for Filter Objects</title>
		<link>http://summitprojectsflashblog.wordpress.com/2011/03/09/jsfl-getting-the-alpha-of-a-color-for-filter-objects/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2011/03/09/jsfl-getting-the-alpha-of-a-color-for-filter-objects/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 19:04:57 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=950</guid>
		<description><![CDATA[This is a follow up to yesterday&#8217;s post, addressing the first of the two caveats I mentioned then. I had said that the alpha associated with a color (whether it&#8217;s the color of the glow or shadow, or highlight of a bevel, or color stop in a gradient) was nowhere to be found in JSFL&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=950&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a follow up to <a href="http://summitprojectsflashblog.wordpress.com/2011/03/08/jsfl-translate-your-flash-professional-on-stage-filters-to-actionscript/">yesterday&#8217;s post</a>, addressing the first of the two caveats I mentioned then.   I had said that the alpha associated with a color (whether it&#8217;s the color of the glow or shadow, or highlight of a bevel, or color stop in a gradient) was nowhere to be found in JSFL&#8217;s filter object, and that I had just used a value of <code>1.0</code> in the generated code.</p>
<p>Turns out I was wrong, but I&#8217;m glad that we do access to this information.</p>
<p>Honestly, I can&#8217;t believe I didn&#8217;t notice it before when I was writing the original script.  If a given color has an alpha of anything other than 100%, the color string is 32-bit, like &#8220;<code>#FF993366</code>&#8220;.   I think what threw me off was that the alpha channel is in the right-most bits, not the left-most bits, like we&#8217;re used to with specifying color-with-alpha in ActionScript, like when working with <code>BitmapData</code>.  It&#8217;s a lame excuse, but I think I was scanning the color values of my test filters, looking for &#8220;<code>#66FF9933</code>&#8220;, but instead seeing the initial &#8220;FF&#8221; and dismissing the value as being 24-bit.</p>
<p>Anyway, there&#8217;s no handy way to extract the alpha information from the color information, but since it&#8217;s actually a string of a hex-format numbers, it&#8217;s fairly simple to do some string manipulation and get the values.  I&#8217;ve updated the original JSFL script with a bit of logic to handle this extraction, as well as updating the use of the colors from the Filter object when converting to ActionScript code.  The key color extraction function is this:</p>
<pre><code>function getColorAndAlpha(color) {
	var colorInfo = {};
	if (color.length == 9) {
		colorInfo.alpha = Math.round(parseInt(color.substr(7, 2), 16) / 0xFF * 100) / 100;
		colorInfo.color = color.substr(0, 7).replace(/^#/, "0x")
	} else if (color.length == 7) {
		colorInfo.alpha = 1;
		colorInfo.color = color.replace(/^#/, "0x")
	} else {
		fl.trace("Problem parsing color.")
	}
	return colorInfo;
}</code></pre>
<p>Pass in the color string from a Filter object, and get back an object with <code>color</code> and <code>alpha</code> properties back, both ready for use in the ActionScript conversion.</p>
<p>The updated script can be found on the original post, or here is the link to the <a href="http://www.summitprojects.com/resources/download/Convert Filters to ActionScript.jsfl">text file again</a>.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/950/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/950/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/950/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/950/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/950/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/950/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/950/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/950/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=950&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2011/03/09/jsfl-getting-the-alpha-of-a-color-for-filter-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Translate Your Flash Professional On-Stage Filters to ActionScript</title>
		<link>http://summitprojectsflashblog.wordpress.com/2011/03/08/jsfl-translate-your-flash-professional-on-stage-filters-to-actionscript/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2011/03/08/jsfl-translate-your-flash-professional-on-stage-filters-to-actionscript/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 23:38:28 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=943</guid>
		<description><![CDATA[The title kinda says it all; if you were creating filters visually (as I was the other day) but needed to ultimately produce them dynamically in ActionScript (as I did), then you may wish (as I did) for a JSFL command to spit out the necessary ActionScript based on your visual, on-stage filters. As you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=943&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The title kinda says it all; if you were creating filters visually (as I was the other day) but needed to ultimately produce them dynamically in ActionScript (as I did), then you may wish (as I did) for a JSFL command to spit out the necessary ActionScript based on your visual, on-stage filters.</p>
<p>As you can guess, I went ahead and wrote that JSFL command.  Here it is (viewable as a text file <a href="http://www.summitprojects.com/resources/download/Convert%20Filters%20to%20ActionScript.jsfl">here</a>):</p>
<pre><code>var sel = fl.getDocumentDOM().selection;
fl.outputPanel.clear();

var iLen = sel.length;
var qualities = {
	low:1,
	medium:2,
	high:3
}
for (var i = 0; i &lt; iLen; i++) {
	var s = sel[i];
	if (s.instanceType != &quot;symbol&quot;) continue;
	fl.trace(&quot;FILTERS FOR &quot; + (s.name == &quot;&quot; ? &quot;UNNAMED INSTANCE&quot; : s.name) + &quot; -------------------------------------&quot;);
	var filters = s.filters;
	var jLen = filters.length;
	for (var j = 0; j &lt; jLen; j++) {
		var f = filters[j];

		for (var p in f) {
			fl.trace(p + &quot; :: &quot; + f[p]);
		}

		var en = f.enabled ? &quot;&quot; : &quot;//&quot;;
		var q = qualities[f.quality];
		if (f.color) {
			var colorInfo = getColorAndAlpha(f.color);
		}
		if (f.highlightColor) {
			var highlightColorInfo = getColorAndAlpha(f.highlightColor);
		}
		if (f.shadowColor) {
			var shadowColorInfo = getColorAndAlpha(f.shadowColor);
		}
		if (f.colorArray) {
			var colorArray = [];
			var alphaArray = [];
			var iLen = f.colorArray.length;
			for (var i = 0; i &lt; iLen; i++) {
				var info = getColorAndAlpha(f.colorArray[i]);
				colorArray.push(info.color);
				alphaArray.push (info.alpha);
			}
		}
		var s = f.strength / 100;

		switch (f.name) {
			case &quot;glowFilter&quot;:
				fl.trace(en + &quot;new GlowFilter(&quot;+colorInfo.color+&quot;, &quot;+colorInfo.alpha+&quot;, &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+s+&quot;, &quot;+q+&quot;, &quot;+f.inner+&quot;, &quot;+f.knockout+&quot;)&quot;);
				break;
			case &quot;dropShadowFilter&quot;:
				fl.trace(en + &quot;new DropShadowFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, &quot;+colorInfo.color+&quot;, &quot;+colorInfo.alpha+&quot;, &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+s+&quot;, &quot;+q+&quot;, &quot;+f.inner+&quot;, &quot;+f.knockout+&quot;, &quot;+f.hideObject+&quot;)&quot;);
				break;
			case &quot;blurFilter&quot;:
				fl.trace(en + &quot;new BlurFilter(&quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+q+&quot;)&quot;);
				break;
			case &quot;bevelFilter&quot;:
				fl.trace(en + &quot;new BevelFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, &quot;+highlightColorInfo.color+&quot;, &quot;+highlightColorInfo.alpha+&quot;, &quot;+shadowColorInfo.color+&quot;, &quot;+shadowColorInfo.alpha+&quot;, &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+f.strength+&quot;, &quot;+q+&quot;, \&quot;&quot;+f.type+&quot;\&quot;, &quot;+f.knockout+&quot;)&quot;);
				break;
			case &quot;gradientBevelFilter&quot;:
				fl.trace(en + &quot;new GradientBevelFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, [&quot;+colorArray+&quot;], [&quot;+alphaArray+&quot;], [&quot;+f.posArray+&quot;], &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+f.strength+&quot;, &quot;+q+&quot;, \&quot;&quot;+f.type+&quot;\&quot;, &quot;+f.knockout+&quot;)&quot;);
				break;
			case &quot;gradientGlowFilter&quot;:
				fl.trace(en + &quot;new GradientGlowFilter(&quot;+f.distance+&quot;, &quot;+f.angle+&quot;, [&quot;+colorArray+&quot;], [&quot;+alphaArray+&quot;], [&quot;+f.posArray+&quot;], &quot;+f.blurX+&quot;, &quot;+f.blurY+&quot;, &quot;+f.strength+&quot;, &quot;+q+&quot;, \&quot;&quot;+f.type+&quot;\&quot;, &quot;+f.knockout+&quot;&quot;);
				break;
			case &quot;adjustColorFilter&quot;:
				var m = new ColorMatrix();
				m.adjustColor(f.brightness, f.contrast, f.saturation, f.hue);
				fl.trace(en + &quot;new ColorMatrixFilter([&quot;+m.matrix+&quot;]);&quot;);
				break;
		}

	}
	fl.trace(&quot;\n&quot;);
}

/**
 * Returns an Object with two properties, color and alpha, as strings, based on the parsing of the color string coming in.  The color string
 * will be something like &quot;#FF9933&quot; or &quot;#FF993366&quot;.  If it&#039;s a 32-bit color, the alpha channel is contained in the last two bytes
 * (66 in this case).
**/
function getColorAndAlpha(color) {
	var colorInfo = {};
	if (color.length == 9) {
		colorInfo.alpha = Math.round(parseInt(color.substr(7, 2), 16) / 0xFF * 100) / 100;
		colorInfo.color = color.substr(0, 7).replace(/^#/, &quot;0x&quot;)
	} else if (color.length == 7) {
		colorInfo.alpha = 1;
		colorInfo.color = color.replace(/^#/, &quot;0x&quot;)
	} else {
		fl.trace(&quot;Problem parsing color.&quot;)
	}
	return colorInfo;
}

// CLASSES ============================================================================

/**
 * Allows for conversion of simple color adjustment properties into an ActionScript-ready matrix Array.
**/
function ColorMatrix(m) {

	this._matrix = m?m.concat():ColorMatrix.IDENTITY_MATRIX.concat();

	/**
	 * Copies the supplied matrix to the internal matrix.
	 * @param	m	Array
	**/
	this.copyMatrix = function(m) {
		this._matrix = m.concat();
	}
	/**
	 * Ensures that the supplied matrix Array is of the correct length.  It slices off extraneous elements, or
	 * fills in missing elements with IDENTITY elements.
	 * @param	m	Array
	 * @return	Fixed Array
	**/
	this.fixMatrix = function(m) {
		if (m.length  ColorMatrix.LENGTH) {
			m = m.slice(0, ColorMatrix.LENGTH);
		}
		return m;
	}

	/**
	 * Makes sure the incoming value in between a negative and positive limit value.
	 * @param	val		The value to clean
	 * @param	limit	The absolute value of the range.  If the limit is 100, then the value is ensured to be between -100 and 100.
	 * @return	Number; the cleaned value.
	**/
	this.cleanValue = function(val, limit) {
		return Math.min(limit, Math.max(-limit, val));
	}

	/**
	 * Core function for translating color adjustments to matrix arrays.  The internal matrix is affected.
	 * @param	m	Array
	**/
	this.multiplyMatrix = function(m) {
		var col = [];

		for (var i=0; i&lt;5; i++) {
			for (j=0; j&lt;5; j++) {
				col[j] = this._matrix[j+i*5];
			}
			for (var j=0; j&lt;5; j++) {
				var val=0;
				for (var k=0; k&lt;5; k++) {
					val += m[j+k*5]*col[k];
				}
				this._matrix[j+i*5] = val;
			}
		}
	}

	/**
	 * Adjusts the internal matrix array to reflect a brightness adjustment.
	 * @param	val		The brightness, from -100 to 100.
	**/
	this.adjustBrightness = function(val) {
		val = this.cleanValue(val,100);
		if (val == 0 || isNaN(val)) { return; }
		this.multiplyMatrix([
			1,0,0,0,val,
			0,1,0,0,val,
			0,0,1,0,val,
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * @param	val	The Contrast, from -100 to 100
	**/
	this.adjustContrast = function(val) {
		val = this.cleanValue(val,100);
		if (val == 0 || isNaN(val)) { return; }
		var x;
		if (val &lt; 0) {
			x = 127 + (val / 100) * 127
		} else {
			x = val % 1;
			if (x == 0) {
				x = ColorMatrix.DELTA_INDEX[val];
			} else {
				//x = ColorMatrix.DELTA_INDEX[(val&lt;&lt;0)]; // this is how the IDE does it.
				x = ColorMatrix.DELTA_INDEX[(val&lt;&lt;0)]*(1-x)+ColorMatrix.DELTA_INDEX[(val&lt; 0) ? 3*val/100 : val/100);
		var lumR = 0.3086;
		var lumG = 0.6094;
		var lumB = 0.0820;
		this.multiplyMatrix([
			lumR*(1-x)+x,lumG*(1-x),lumB*(1-x),0,0,
			lumR*(1-x),lumG*(1-x)+x,lumB*(1-x),0,0,
			lumR*(1-x),lumG*(1-x),lumB*(1-x)+x,0,0,
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * @param	val	The Hue, from -180 to 180
	**/
	this.adjustHue = function(val) {
		val = this.cleanValue(val,180)/180*Math.PI;
		if (val == 0 || isNaN(val)) { return; }
		var cosVal = Math.cos(val);
		var sinVal = Math.sin(val);
		var lumR = 0.213;
		var lumG = 0.715;
		var lumB = 0.072;
		this.multiplyMatrix([
			lumR+cosVal*(1-lumR)+sinVal*(-lumR),lumG+cosVal*(-lumG)+sinVal*(-lumG),lumB+cosVal*(-lumB)+sinVal*(1-lumB),0,0,
			lumR+cosVal*(-lumR)+sinVal*(0.143),lumG+cosVal*(1-lumG)+sinVal*(0.140),lumB+cosVal*(-lumB)+sinVal*(-0.283),0,0,
			lumR+cosVal*(-lumR)+sinVal*(-(1-lumR)),lumG+cosVal*(-lumG)+sinVal*(lumG),lumB+cosVal*(1-lumB)+sinVal*(lumB),0,0,
			0,0,0,1,0,
			0,0,0,0,1
		]);
	}

	/**
	 * Adjust all four properties at once
	 * @param	brightness (-100 - 100)
	 * @param	contrast (-100 - 100)
	 * @param	saturation (-100 - 100)
	 * @param	hue (-180 - 180)
	**/
	this.adjustColor = function(brightness, contrast, saturation, hue) {
		this.adjustHue(hue);
		this.adjustContrast(contrast);
		this.adjustBrightness(brightness);
		this.adjustSaturation(saturation);
	}

	this.__defineGetter__(&quot;matrix&quot;, function() {return this._matrix.concat(); });
	this.toString = function() {
		//return &quot;ColorMatrix: &quot; + this._matrix.toString();
		var out = &quot;ColorMatrix:\n&quot;;
		var v;
		var iLen = this._matrix.length;
		var l = 4;
		for (var i = 0; i  l) {
				v = v.substr(0, l);
			} else {
				while (v.length &lt; l) {
					v += &quot; &quot;;
				}
			}
			out += v;
			if (i % 5 == 4) {
				out += &quot;\n&quot;;
			} else {
				out += &quot; &quot;;
			}
		}
		return out;
	}

}

ColorMatrix._DELTA_INDEX = [
	0,    0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1,  0.11,
	0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.20, 0.21, 0.22, 0.24,
	0.25, 0.27, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42,
	0.44, 0.46, 0.48, 0.5,  0.53, 0.56, 0.59, 0.62, 0.65, 0.68,
	0.71, 0.74, 0.77, 0.80, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98,
	1.0,  1.06, 1.12, 1.18, 1.24, 1.30, 1.36, 1.42, 1.48, 1.54,
	1.60, 1.66, 1.72, 1.78, 1.84, 1.90, 1.96, 2.0,  2.12, 2.25,
	2.37, 2.50, 2.62, 2.75, 2.87, 3.0,  3.2,  3.4,  3.6,  3.8,
	4.0,  4.3,  4.7,  4.9,  5.0,  5.5,  6.0,  6.5,  6.8,  7.0,
	7.3,  7.5,  7.8,  8.0,  8.4,  8.7,  9.0,  9.4,  9.6,  9.8,
	10.0
];
ColorMatrix._IDENTITY_MATRIX = [
	1,0,0,0,0,
	0,1,0,0,0,
	0,0,1,0,0,
	0,0,0,1,0,
	0,0,0,0,1
]
ColorMatrix._LENGTH = ColorMatrix._IDENTITY_MATRIX.length;

ColorMatrix.__defineGetter__(&quot;DELTA_INDEX&quot;,     function() { return ColorMatrix._DELTA_INDEX; } );
ColorMatrix.__defineGetter__(&quot;IDENTITY_MATRIX&quot;, function() { return ColorMatrix._IDENTITY_MATRIX; } );
ColorMatrix.__defineGetter__(&quot;LENGTH&quot;,          function() { return ColorMatrix._LENGTH; } );</code></pre>
<p>I have tested this with a variety of symbol instances with a variety of filters applied to them.  Seems to work for me, but I really only used it for my recent application.  Please let us know if you run into issues that break the script or produce erroneous results.</p>
<p><strong>A few caveats:</strong></p>
<p>This script doesn&#8217;t do two things, both of which are significant to know about.</p>
<p>(<strong>UPDATE</strong>: I have since resolved the first item below.  See <a href="http://summitprojectsflashblog.wordpress.com/2011/03/09/jsfl-getting-the-alpha-of-a-color-for-filter-objects/">this post</a> for more information.  The code above as well as the linked text file have been updated with the new code)</p>
<p>(<strong>UPDATE 2</strong>: I&#8217;ve also resolved the second item.  <a href="http://summitprojectsflashblog.wordpress.com/2011/05/31/jsfl-filter-to-actionscript-update-now-with-color-adjustment-filter-support/">This post</a> has more information, and the code on this page has been updated.)</p>
<ol>
<li><del datetime="2011-03-09T19:05:15+00:00">For some reason, the JSFL Filter object doesn&#8217;t contain information about the color&#8217;s alpha of a filter.  All filters except for the Blur and Adjust Color (ColorMatrixFilter) have an option for alpha, both in the IDE&#8217;s interface and in the ActionScript object.  But this information is not contained in the JSFL information.  Go figure.  So, in all cases where an alpha parameter is expected in the ActionScript constructor, I supply a value of 1.</del></li>
<li><del datetime="2011-05-31T23:31:42+00:00">I trust it&#8217;s possible to work out the logic to convert the Adjust Color filter in the IDE to a ColorMatrixFilter in ActionScript, but that requires conversion of &#8220;saturation&#8221; and &#8220;contrast&#8221; settings in the IDE to an Array of numbers in ActionScript.  I hope to eventually do this, but for now, I just wanted to post this script.</del></li>
</ol>
<p>I also hope to reconsider how to abstract some of this functionality into some JSFL classes.  Someday&#8230;</p>
<p>So, feel free to use, and I hope I just saved you a few minutes.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/943/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=943&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2011/03/08/jsfl-translate-your-flash-professional-on-stage-filters-to-actionscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>Summit Projects at the Rosey Awards</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/12/04/summit-projects-at-the-rosey-awards/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/12/04/summit-projects-at-the-rosey-awards/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 00:09:29 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=935</guid>
		<description><![CDATA[Summit had a few entries at the Rosey Awards this year. We came away three Excellence Awards (which, as our Creative Director Eddy put it, is one among a few of the best, like being nominated but not winning an Oscar). These were for the Nike Golf website, the Nike Golf Outerwear microsite, and for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=935&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Summit had a few entries at the <a href="http://www.roseys2010.com">Rosey Awards</a> this year.  We came away three Excellence Awards (which, as our Creative Director Eddy put it, is one among a few of the best, like being nominated but not winning an Oscar).  These were for the <a href="http://www.nikegolf.com">Nike Golf website</a>, the <a href="http://www.nike.com/nikeos/p/nikegolf/en_US/experiences/outerwear">Nike Golf Outerwear microsite</a>, and for our own <a href="http://www.summitprojects.com">Summit Projects website</a>.</p>
<p>Better yet, we came home with a &#8220;Best of Show&#8221; award, in the motion graphics category, for the Nike Golf SQ Machspeed Driver video (sadly, not actually online anymore, although you can see it on the Roseys&#8217; site <a href="http://www.roseys2010.com/nike-golf-sq-machspeed-video">here</a>).</p>
<p>Here are some photos from the event, which had an open bar and (accordingly) a lot of good times (photos taken by Eddy).</p>
<p><div id="attachment_938" class="wp-caption alignnone" style="width: 500px"><a href="http://summitprojectsflashblog.files.wordpress.com/2010/12/event.jpeg"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/12/event.jpeg?w=490&#038;h=149" alt="" title="Roseys 2010 - Main Event Room" width="490" height="149" class="size-full wp-image-938" /></a><p class="wp-caption-text">The main event room</p></div><br />
<div id="attachment_937" class="wp-caption alignnone" style="width: 500px"><a href="http://summitprojectsflashblog.files.wordpress.com/2010/12/awardroom.jpg"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/12/awardroom.jpg?w=490&#038;h=365" alt="" title="Roseys 2010 - The Award Room" width="490" height="365" class="size-full wp-image-937" /></a><p class="wp-caption-text">Here&#039;s the award for Motion Design, on display in the Award Room</p></div><br />
<div id="attachment_936" class="wp-caption alignnone" style="width: 500px"><a href="http://summitprojectsflashblog.files.wordpress.com/2010/12/awardcloseup.jpg"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/12/awardcloseup.jpg?w=490&#038;h=777" alt="" title="Roseys 2010 - The Motion Design award in hand" width="490" height="777" class="size-full wp-image-936" /></a><p class="wp-caption-text">We did get to pick up the award and bring it home.  The computer playing the video had to stay.</p></div></p>
<p>It&#8217;s an honor to be a part of the team that does this amazing work!  Working on Nike Golf alone is a constant challenge and surprise.  Our creative team really pitches some awesome stuff, and then we technical folk get to build it.  It&#8217;s a good day to be a Summiteer.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/935/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=935&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/12/04/summit-projects-at-the-rosey-awards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/12/event.jpeg" medium="image">
			<media:title type="html">Roseys 2010 - Main Event Room</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/12/awardroom.jpg" medium="image">
			<media:title type="html">Roseys 2010 - The Award Room</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/12/awardcloseup.jpg" medium="image">
			<media:title type="html">Roseys 2010 - The Motion Design award in hand</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Get Notifications on a Bad Document Class</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/11/29/jsfl-get-notifications-on-a-bad-document-class/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/11/29/jsfl-get-notifications-on-a-bad-document-class/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 19:39:03 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=857</guid>
		<description><![CDATA[The Problem I don&#8217;t know about everyone else, but this has happened to me more times than I can count. For one reason or another, the link between document class and FLA gets lost. Maybe you moved the FLA file and now it can&#8217;t find the class path, or maybe you refactored your code and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=857&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>The Problem</h3>
<p>I don&#8217;t know about everyone else, but this has happened to me more times than I can count.  For one reason or another, the link between document class and FLA gets lost.  Maybe you moved the FLA file and now it can&#8217;t find the class path, or maybe you refactored your code and put the class in a new package, and forgot to update the FLA file.  </p>
<p>Of course, when you ask Flash to verify your document class, it will tell you if it can&#8217;t find one.  But that&#8217;s only if you ask.  If you open up a file that had worked in the past, but now doesn&#8217;t, Flash won&#8217;t tell you.  It will simply create the supposed class for you, as an empty MovieClip subclass, when you publish the file.</p>
<h3>The solution</h3>
<p>For some reason, this has happened to me enough that I gave it some thought, and have come up with a rudimentary way of asking Flash to check the validity of the document class for you.  This involves a JSFL script that checks for the existence of a file, derived from the document class name and the various class paths available to that document.  Most importantly, it registers an event listener for documentChanged, so this check will run any time you open up or switch to a different a Flash file.</p>
<p>The issue I&#8217;m facing right now is making it happen automatically; right now you have to execute the script, at which point the listener gets set up and you&#8217;re good to go, but you have to still execute the script.  It would be nice to have it execute right away once Flash starts up.  Seems like a WindowSWF or a Tool could accomplish that, but both of those would require that you have extension installed and open as part of your workspace.</p>
<h3>The Important Things to Note</h3>
<p>Please note these two important things:</p>
<ol>
<li><strong>The script is Mac-only as written</strong>.  This is easily fixed, all you have to do is update the <code>tmpFilePath</code> variable as appropriate.</li>
<li><strong>The script depends on the SourcePath class</strong>.  You can find out more about that in <a href="http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/">this post</a>, and you may wish/need to update the first line of the script so that it loads the SourcePath class from the place where you&#8217;ve installed it. Oh, to have a more robust class management system with JSFL.</li>
</ol>
<h3>The Script</h3>
<p>I banged this out pretty quick, because I&#8217;m supposed to be doing other things, so, there&#8217;s room for improvement.  Here&#8217;s the source code (viewable and downloadable at <a href="http://www.summitprojects.com/resources/download/Document%20Class%20Checker.jsfl">this link</a>, as well):</p>
<pre><code>fl.runScript(fl.configURI + "Commands/lib/SourcePath.jsfl");

var tmpFilePath = "file:///tmp/docClassCheckerIds.txt";

if (FLfile.exists(tmpFilePath)) {
	var contents = FLfile.read(tmpFilePath);
	var lines = contents.split("\n");
	var iLen = lines.length;
	for (var i = 0; i &lt; iLen; i++) {
		var line = lines[i];
		var pieces = line.split(&quot;=&quot;);
		var eventType = pieces[0];
		var eventId   = pieces[1];
		fl.removeEventListener(eventType, parseInt(eventId));
	}
}

var changeId = fl.addEventListener(&quot;documentChanged&quot;, onDocumentOpened);

FLfile.write(tmpFilePath, &quot;documentChanged=&quot; + changeId);

function onDocumentOpened() {
	fl.trace(&quot;Event happened.&quot;)
	testForDocumentClass();
}

function testForDocumentClass() {

	var doc = fl.getDocumentDOM();
	if (!doc) return;
	if (doc.asVersion &lt; 3) return;

	var documentClass = doc.docClass;
	if (documentClass == &quot;&quot;) return;

	var source = new SourcePath();
	var classPaths = source.pathsURI;

	var iLen = classPaths.length;
	var classPath;
	var docClassPath = documentClass.replace(/\./g, &quot;/&quot;) + &quot;.as&quot;;
	for (var i = 0; i &lt; iLen; i++) {
		classPath = classPaths[i];
		if (FLfile.exists(classPath + docClassPath)) {
			// We found a matching file, so no further action is required.
			return;
		}
	}

	// If we got here, we didn&#039;t break the loop on success, so we didn&#039;t find a Document Class.
	alert(&quot;Couldn&#039;t find a document class called \&quot;&quot;+documentClass+&quot;\&quot; for this document.&quot;);
}

testForDocumentClass();
</code></pre>
<h3>The Geeky Discussion</h3>
<p>If you&#8217;re interested in some of the details, the logic is pretty straightforward, thanks to the SourcePath class.  The bulk of it involves just looping over all of the available source paths, concatenating that to a file-system version of the stated document class for the file, and checking to see if a file exists at that path.  If we get just one match, then we&#8217;re good.  If we have no matches, we throw up an alert box.</p>
<p>I spent a little extra time on the event management.  Because I was afraid of accidentally running the script more than once in a session, I wanted to make sure we removed any previously existing event listeners.  This was troublesome, however, thanks to the undocumented changes in how the event listener functions operate.  <a href="http://summitprojectsflashblog.wordpress.com/2010/11/08/jsfl-get-fl-removeeventlistener-to-work/">See this post</a> for more details.</p>
<p>My solution involved capturing the event IDs, and writing them to a temporary file.  Then, if we can get the ids out of this file, we remove the event listener based on this id before we add it.  That is, if the script is run a second time, we&#8217;ll clean up the events set in the first run.  Kinda laborious, but at least it works.  Otherwise, you run the risk of seeing that alert several times in a row.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/857/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=857&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/11/29/jsfl-get-notifications-on-a-bad-document-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: DynamicXUL class</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/11/12/jsfl-dynamicxul-class/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/11/12/jsfl-dynamicxul-class/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 19:03:17 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=887</guid>
		<description><![CDATA[Based on previous ramblings on &#8220;dynamic XUL,&#8221; and seeing as I needed that technique again recently, I decided it might be worthwhile to wrap it up in a class. I got a little over-ambitious on this one, and decided to try and do away with the yucky write-XML-in-JavaScript-as-a-String business. So the new class not only [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=887&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Based on <a href="http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/">previous ramblings on &#8220;dynamic XUL,&#8221;</a> and seeing as I needed that technique again recently, I decided it might be worthwhile to wrap it up in a class.  I got a little over-ambitious on this one, and decided to try and do away with the yucky write-XML-in-JavaScript-as-a-String business.  So the new class not only handles the creation, execution, and cleanup of an on-the-fly XUL window, but you can optionally also use instance methods to create your XUL controls without writing XML directly.  Sound neat?  WELL, IT IS!</p>
<p>First up, some example code.</p>
<h3>Simplifying the XUL File Process</h3>
<p>In this example, I&#8217;m taking the example from the <a href="http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/">post of dynamic XUL</a> and using the XULWindow class to abstract away the process of creating, using, and deleting the temporary XUL file.</p>
<pre><code>fl.runScript(fl.configURI + &quot;Commands/lib/SourcePath.jsfl&quot;);
fl.runScript(fl.configURI + &quot;Commands/lib/XULWindow.jsfl&quot;);

var sources = new SourcePath();
<strong>var window = new XULWindow();</strong>

var classPathXul = &quot;&quot;;
for (var i = 0; i &lt; sources.paths.length; i++) {
	classPathXul += &#x27;		&lt;radio id=&quot;&#x27;+(i.toString())+&#x27;&quot; label=&quot;&#x27;+sources.paths[i]+&#x27;&quot; /&gt;\n&#x27;
}

var xul = &#x27;&lt;dialog title=&quot;Select a class path in which to create classes&quot; buttons=&quot;accept,cancel&quot;&gt;\n&#x27;
+ &#x27;	&lt;radiogroup id=&quot;selection&quot;&gt;\n&#x27;
+ 		classPathXul
+ &#x27;	&lt;/radiogroup&gt;\n&#x27;
+ &#x27;&lt;/dialog&gt;&#x27;;

<strong>var classPath = window.create(xul);</strong>

if (classPath.dismiss == &quot;accept&quot;) {
	fl.trace(&quot;classPath.selection: &quot; + classPath.selection);
} else {
	// Bye.
}</code></pre>
<p>Notice that the lines involving creating and writing the temporary XUL file are gone, instead, we create a new XUL window object and tell it to <code>create</code>, passing in the XUL string we&#8217;ve generated.</p>
<p>I&#8217;ve also changed the class to use the <a href="http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/">SourcePath class</a>, further simplifying the script.</p>
<h3>Simplifying the XUL Creation Process</h3>
<p>Here, I&#8217;ve rewritten the example yet again, this time I&#8217;m taking advantage of the methods provided by XULWindow to avoid having to write the XUL myself.</p>
<pre><code>fl.runScript(fl.configURI + &quot;Commands/lib/SourcePath.jsfl&quot;);
fl.runScript(fl.configURI + &quot;Commands/lib/XULWindow.jsfl&quot;);

var sources = new SourcePath();
<strong>var window = new XULWindow(&quot;Select a class path in which to create classes&quot;, XULWindow.ACCEPT, XULWindow.CANCEL);</strong>

var classPaths = [];
for (var i = 0; i &lt; sources.paths.length; i++) {
	<strong>classPaths.push({label:sources.paths[i]})</strong>
}
<strong>window.addRadioGroup(&quot;selection&quot;, classPaths)</strong>

var classPath = window.create();

if (classPath.dismiss == &quot;accept&quot;) {
	fl.trace(&quot;classPath.selection: &quot; + classPath.selection);
} else {
	// Bye.
}</code></pre>
<p>Now, we&#8217;re passing in key parameters to the XULWindow constructor, and using <code>addRadioGroup</code> to create the controls on the window.  A call to <code>create</code>, with no XUL string passed in, will use the internally constructor XUL, based on the other input received to the object.  The end result is the same.</p>
<h3>Documentation</h3>
<p>I worked up some quick ASDoc for the class, which can be found <a href="http://www.summitprojects.com/resources/docs/jsfl/XULWindow.html">here</a> (or the combined documentation is now available <a href="http://www.summitprojects.com/resources/docs/jsfl/">here</a>).</p>
<h3>Source Code</h3>
<p>Finally, here is the source code of the class itself, which is also posted <a href="http://www.summitprojects.com/resources/download/XULWindow.jsfl">here</a>, as well as documentation here.</p>
<pre><code>/**
 * Represents a XUL panel in JSFL.  The object can be set up and then used to invoke a XUL panel without writing an actual XUL file.
 * The XML can be generated purely in JSFL and passed in, or you can use convenience methods to add various controls without having
 * to writing XML strings in JSFL.
 *
 * &lt;p&gt;For full-on XUL reference, the Mozilla document is here: &lt;a href=&quot;https://developer.mozilla.org/en/XUL_Reference&quot;&gt;
 * https://developer.mozilla.org/en/XUL_Reference&lt;/a&gt;.  Note that Flash supports a very small subset of this.&lt;/p&gt;
 *
**/

/**
 * Constructor
 * @param	title	The title of the window.  This is only used if you own XML string is not passed in to the &lt;code&gt;create&lt;/code&gt;
 * 					method.
 * @param	buttons	The remaining arguments are Strings of types of buttons to include.  For convenience, use the static
 * 					constants XULWindow.ACCEPT and XULWindow.CANCEL.  This is only used if you own XML string is not passed in to
 * 					the &lt;code&gt;create&lt;/code&gt; method.
**/
 function XULWindow(title) {
	var that = this;
	this._title = title || &quot;Options&quot;;
	var buttons = [];
	var iLen = arguments.length;
	for (var i = 1; i &lt; iLen; i++) {
		buttons.push(arguments[i]);
	}
	this._xml = &#x27;&lt;dialog title=&quot;&#x27;+title+&#x27;&quot; buttons=&quot;&#x27;+buttons.join(&quot;,&quot;)+&#x27;&quot;&gt;&#x27;;
	this._tab = 1;

	/**
	 * Creates a XUL window panel.  It is attached to the current document
	 *
	 * @param	xul		A String of raw XUL to create.  If null, the window will be created according to the various control
	 * 					creation methods.  If not null, any other method calls would be ignored and the passed-in XUL is used.
	 * @return	An object containing information about the user input.  The object will have a property called &lt;code&gt;dismiss&lt;/code&gt;
	 * 			that contains the name of the button that was clicked (either &lt;code&gt;XULWindow.ACCEPT&lt;/code&gt; or
	 * 			&amp;lt;code&gt;XULWindow.CANCEL&lt;/code&gt;).  It will
	 * 			also have other properties, named after the various controls&#x27; id values.  The value contained by these properties
	 * 			will be the value associated with the input of the control.
	**/
	this.create = function(xul) {
		var doc = fl.getDocumentDOM();
		if (!doc) {
			alert(&quot;There is no open document.  XUL Windows need to be attached to a document. [XULWindow::create()]&quot;);
			return;
		}

		var xulFilePath = fl.configURI + escape(this._title) + &quot;.xul&quot;;

		if (xul==null) xul = this._xml + &quot;&lt;/dialog&gt;&quot;;

		FLfile.write(xulFilePath, xul);
		var options = fl.getDocumentDOM().xmlPanel(xulFilePath);
		FLfile.remove(xulFilePath);

		return options//.dismiss;

	}

	/**
	 * Creates a check box control with a label.
	 * @param	label	String for the label next to the check box.
	 * @param	id		String for the id of the checkbox.  This is the name of the property on the returned object with data in it
	 * @param	checked	Whether initially checked or not.
	**/
	this.addCheckbox = function(label, id, checked) {
		this._xml += &#x27;&lt;checkbox label=&quot;&#x27;+label+&#x27;&quot; id=&quot;&#x27;+id+&#x27;&quot; checked=&quot;&#x27;+(checked?&quot;true&quot;:&quot;false&quot;)+&#x27;&quot; /&gt;&#x27;;
	}

	/**
	 * Opens an &amp;lt;hbox&amp;gt; nodes so that all controls added after this method call are contained within the hbox.  Should
	 * be ultimately terminated with &lt;a href=&quot;#closeHBox&quot;&gt;closeHBox&lt;/a&gt;
	 *
	 * @see #closeHBox
	**/
	this.openHBox = function() {
		this._xml += &quot;&lt;hbox&gt;&quot;;
	}

	/**
	 * Closes a previously open &amp;lt;hbox&amp;gt;, enclosing all intermediate controls within an hbox node.
	 *
	 * @see #openHBox
	**/
	this.closeHBox = function() {
		this._xml += &quot;&lt;/hbox&gt;&quot;;
	}

	/**
	 * Opens an &amp;lt;vbox&amp;gt; nodes so that all controls added after this method call are contained within the vbox.  Should
	 * be ultimately terminated with &lt;a href=&quot;#closeVBox&quot;&gt;closeVBox&lt;/a&gt;
	 *
	 * @see #closeVBox
	**/
	this.openVBox = function() {
		this._xml += &quot;&lt;vbox&gt;&quot;;
	}

	/**
	 * Closes a previously open &amp;lt;vbox&amp;gt;, enclosing all intermediate controls within an vbox node.
	 *
	 * @see #openVBox
	**/
	this.closeVBox = function() {
		this._xml += &quot;&lt;/vbox&gt;&quot;;
	}

	/**
	 * @private
	 * Adds a button to the panel, but I assume there might be more involved in getting one to do something than we can realistically
	 * accomplish here.
	**/
	this.addButton = function(label, id, accessKey, autocheck) {
		this._xml += &#x27;&lt;button label=&quot;&#x27;+label+&#x27;&quot; id=&quot;&#x27;+id+&#x27;&quot; accesskey=&quot;&#x27;+accessKey+&#x27;&quot; autocheck=&quot;&#x27;+autocheck+&#x27;&quot; tabindex=&quot;&#x27;+(this._tab++)+&#x27;&quot; /&gt;&#x27;;
	}

	/**
	 * Creates a List Box.
	 * @param	id		The name of the property on the returned object with data in it.
	 * @param	items	Array of Objects specifying the items to display.  The Objects should take on the following form:
	 * 						&lt;code&gt;{label:&quot;Text to display&quot;, value:&quot;valueOfThisItem&quot;, selected:true}&lt;/code&gt;
	 * 						&lt;code&gt;label&lt;/code&gt; is required.  If &lt;code&gt;value&lt;/code&gt; is omitted, the &lt;code&gt;label&lt;/code&gt; is returned
	 * 						as the selected value.
	 * @param	width	The width in pixels. Defaults to 200.
	 * @param	rows	The number of rows to display in the viewable area.  If the &lt;code&gt;rows&lt;/code&gt; is less than the number of
	 * 					items in the list, scrollbars will appear.  If this parameter is omitted, the length of the Array passed
	 * 					in to &lt;code&gt;items&lt;/code&gt; is used.
	**/
	this.addListBox = function(id, items, width, rows) {
		var signature = &quot;addListBox(id:String, items:Array, width:Number=NaN, rows:Number=NaN)&quot;
		if (!id) {
			alert(&quot;XULWindow::addListBox() requires an id parameter.\n\t&quot; + signature);
			return;
		}
		if (!items) {
			alert(&quot;XULWindow::addListBox() requires an items parameter.\n\t&quot; + signature);
			return;
		}
		if (isNaN(width)) { width = 200; }
		if (isNaN(rows)) { rows = items.length; }

		this._xml += &#x27;&lt;listbox id=&quot;&#x27;+id+&#x27;&quot; width=&quot;&#x27;+width+&#x27;&quot; rows=&quot;&#x27;+rows+&#x27;&quot;&gt;\n&#x27;;
		var iLen = items.length;
		var item;
		var selected;
		var value;
		for (var i = 0; i &lt; iLen; i++) {
			item = items[i];
			if (!item.label) {
				alert(&quot;The items parameter of XULWindow::addListBox() needs to be an Array of Objects, each Object consisting of&quot;
				+ &quot; at least a label property, and optionally a value and a selected property.&quot;)
				return;
			}
			value    = item.value    ? &#x27;value=&quot;&#x27;+item.value+&#x27;&quot; &#x27; : &#x27;&#x27;;
			selected = item.selected ? &#x27;selected=&quot;&#x27;+item.selected+&#x27;&quot; &#x27; : &#x27;&#x27;;

			this._xml += &#x27;\t&lt;listitem &#x27;+value+&#x27;label=&quot;&#x27; + item.label + &#x27;&quot; &#x27;+selected+&#x27;/&gt;\n&#x27;;
		}
		this._xml += &quot;&lt;/listbox&gt;\n&quot;;
	}

	/**
	 * Adds a basic text label.
	 * @param	label	The text to display in the label.
	 * @param	control	The id of the associated control.  If the user clicks on the label, focus is moved to the control. (Doesn&#x27;t work?)
	**/
	this.addLabel = function(label, control) {
		this._xml += &#x27;&lt;label value=&quot;&#x27;+label+&#x27;&quot; control=&quot;&#x27;+control+&#x27;&quot;/&gt;\n&#x27;;
	}

	/**
	 * Adds a text box in which the user can type.
	 * @param	id		The name of the property on the returned data object.
	 * @param	value	The default value contained within the text box.
	**/
	this.addTextBox = function(id, value) {

		this._xml += &#x27;&lt;textbox id=&quot;&#x27;+id+&#x27;&quot; value=&quot;&#x27;+value+&#x27;&quot; /&gt;&#x27;
	}

	/**
	 * Creates a vertically-oriented group of radio buttons.
	 * @param	id		The name of the property on the returned object with data in it.
	 * @param	items	Array of Objects specifying the buttons to display.  The Objects should take on the following form:
	 * 						&lt;code&gt;{label:&quot;Text to display&quot;, value:&quot;valueOfThisButton&quot;, selected:true}&lt;/code&gt;
	 * 						&lt;code&gt;label&lt;/code&gt; is required.  If &lt;code&gt;value&lt;/code&gt; is omitted, the &lt;code&gt;label&lt;/code&gt; is returned
	 * 						as the selected value.
	**/
	this.addRadioGroup = function(id, items) {
		var signature = &quot;addRadioGroup(id:String, items:Array)&quot;
		if (!id) {
			alert(&quot;XULWindow::addRadioGroup() requires an id parameter.\n\t&quot; + signature);
			return;
		}
		if (!items) {
			alert(&quot;XULWindow::addRadioGroup() requires an items parameter.\n\t&quot; + signature);
			return;
		}

		this._xml += &#x27;&lt;radiogroup id=&quot;&#x27;+id+&#x27;&quot;&gt;\n&#x27;;
		var iLen = items.length;
		var item;
		var selected;
		var value;
		for (var i = 0; i &lt; iLen; i++) {
			item = items[i];
			if (!item.label) {
				alert(&quot;The items parameter of XULWindow::addRadioGroup() needs to be an Array of Objects, each Object consisting of&quot;
				+ &quot; at least a label property, and optionally a value and a selected property.&quot;)
				return;
			}
			value    = item.value    ? &#x27;value=&quot;&#x27;+item.value+&#x27;&quot; &#x27; : &#x27;&#x27;;
			selected = item.selected ? &#x27;selected=&quot;&#x27;+item.selected+&#x27;&quot; &#x27; : &#x27;&#x27;;

			this._xml += &#x27;\t&lt;radio &#x27;+value+&#x27;label=&quot;&#x27; + item.label + &#x27;&quot; &#x27;+selected+&#x27;/&gt;\n&#x27;;
		}
		this._xml += &quot;&lt;/radiogroup&gt;\n&quot;;

	}
}

/**
 * Static constant alias for the name of the &quot;accept&quot; button.
**/
XULWindow.__defineGetter__(&quot;ACCEPT&quot;, function(){ return &quot;accept&quot;; });
/**
 * Static constant alias for the name of the &quot;cancel&quot; button.
**/
XULWindow.__defineGetter__(&quot;CANCEL&quot;, function(){ return &quot;cancel&quot;; });
</code></pre>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/887/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=887&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/11/12/jsfl-dynamicxul-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Offline AS3 Documentation in CS5</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/11/10/get-offline-as3-documentation-in-cs5/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/11/10/get-offline-as3-documentation-in-cs5/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 17:52:15 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=903</guid>
		<description><![CDATA[With Flash CS4, Adobe moved away from the Help window and towards displaying online documentation in your browser. There was the handy Connections window trick that let you access local (offline) documentation, which was speedier to use than the documentation at adobe.com. With CS5, all help is still online, but now it&#8217;s routed to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=903&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Flash CS4, Adobe moved away from the Help window and towards displaying online documentation in your browser.  There was the handy <a href="http://www.gotoandlearnforum.com/viewtopic.php?f=5&amp;t=21606">Connections window trick</a> that let you access local (offline) documentation, which was speedier to use than the documentation at adobe.com.  With CS5, all help is still online, but now it&#8217;s routed to the Adobe Help application, which, honestly, is even worse than opening online documentation in your browser.  And it made it much harder to find local copies of the documentation.  But there is a way!</p>
<h3 id="step_1_launch_adobe_help">Step 1: Launch Adobe Help</h3>
<p>I know, it&#8217;s painful, but this might be the last time you have to do it.</p>
<h3 id="step_2_open_preferences">Step 2: Open Preferences</h3>
<p>On the Mac, it&#8217;s under the standard location: <strong>Adobe Help &gt; Preferences…</strong>, or <strong>Command-Comma</strong>.  On the PC, I don&#8217;t know, as I don&#8217;t have a access to a PC with CS5 installed.  Maybe under <strong>Edit &gt; Preferences</strong>?</p>
<h3 id="step_3_go_to_download_preferences">Step 3: Go to Download Preferences</h3>
<p>Here, you can check the applications for which you want to download help content, and, depending on the application, which sections of the help content for that application.</p>
<p><a href="http://summitprojectsflashblog.files.wordpress.com/2010/11/adobe-helpscreensnapz001.png"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/11/adobe-helpscreensnapz001.png?w=490&#038;h=297" alt="" title="Adobe Help Preferences: Download Preferences" width="490" height="297" class="alignnone size-full wp-image-915" /></a></p>
<p>You&#8217;ll want to make sure Flash CS5 has a full checkmark; the default is partial content.  Just go ahead and check everything that you feel you&#8217;ll be using; want speedier access to the After Effects docs?  Go for it.  It&#8217;s not an insignificant amount of space, but the all docs for the entire Master Collection take a total of like 430 MB of help content; not bad considering.</p>
<p>Then again, if you&#8217;re just after AS3 docs, you might want to check <em>just</em> that for now for a quicker download.</p>
<h3 id="step_4_watch_the_progress_in_local_content">Step 4: Watch the Progress in Local Content</h3>
<p>Local Content in the side bar doesn&#8217;t allow you to do much, just monitor what has and hasn&#8217;t downloaded.  But you&#8217;ll want to have this up for the next step.</p>
<p><a href="http://summitprojectsflashblog.files.wordpress.com/2010/11/adobe-helpscreensnapz002.png"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/11/adobe-helpscreensnapz002.png?w=490&#038;h=297" alt="" title="Adobe Help Preferences: Local Content" width="490" height="297" class="alignnone size-full wp-image-916" /></a></p>
<h3 id="step_5_wait">Step 5: Wait.</h3>
<p>Things are going to download.  You don&#8217;t have much control over the order in which things download, but the key is to wait for Flash CS5 to fully download.  Don&#8217;t quit Adobe Help while this is going on.  </p>
<p>Once everything is downloaded, or at least the AS3 Language and Component Reference, close the Preferences window and notice how much snappier browsing around the documentation is.</p>
<h3 id="step_6_find_the_local_files">Step 6: Find the Local Files</h3>
<p>Your files will be here:</p>
<p><strong>Mac</strong></p>
<p><code>~/Library/Preferences/chc.4875E02D9FB21EE389F73B8D1702B320485DF8CE.1/Local Store/Help/[locale]/<br />
</code></p>
<p><strong>Windows</strong></p>
<p><code>%appdata%\chc.4875E02D9FB21EE389F73B8D1702B320485DF8CE.1\Local Store\Help\[locale]\<br />
</code></p>
<p>I know, completely crazy preference name, right?</p>
<p>At this point, it&#8217;s somewhat obvious where the files are.  Our interest right now is to get the AS3 Language Reference in our browser, and that is at <code>Flash/CS5/AS3LR/index.html</code>, relative to the platform-specific path above.</p>
<h3 id="step_7_rock_the_docs_in_textmate">Step 7: Rock the Docs in TextMate</h3>
<p>One last bonus step for TextMate users.  Create a command that looks like this:</p>
<ul>
<li><strong>Save</strong>: Nothing</li>
<li><strong>Command(s)</strong>: <code>echo "&lt;meta http-equiv='Refresh' content='0;URL=file:///<strong>[path-to-your-home-folder]</strong>/Library/Preferences/chc.4875E02D9FB21EE389F73B8D1702B320485DF8CE.1/Local%20Store/Help/en_US/Flash/CS5/AS3LR/index.html'&gt;"</code></li>
<li><strong>Input</strong>: None</li>
<li><strong>Output</strong>: Show as HTML</li>
<li><strong>Activation</strong>: <em>Your choice; I like Command-Option-Shift-?</em></li>
<li><strong>Scope Selector</strong>: source.actionscript.3</li>
</ul>
<p><strong>Note:</strong> The above command has <code>[path-to-your-home-folder]</code> that needs to be replaced for your machine.</p>
<p>Also, because our current WordPress theme has trouble wrapping things, here&#8217;s the entire text of the command again:</p>
<p><textarea rows="5" cols="50">echo &#8220;&lt;meta http-equiv=&#8217;Refresh&#8217; content=&#8217;0;URL=file:///[path-to-your-home-folder]/Library/Preferences/chc.4875E02D9FB21EE389F73B8D1702B320485DF8CE.1/Local%20Store/Help/en_US/Flash/CS5/AS3LR/index.html&#8217;&gt;&#8221;</textarea></p>
<p>Now, after invoking the command, you&#8217;ll get a nice WebKit rendition of the AS3 documentation, all without leaving TextMate.</p>
<h3 id="that8217s_all">That&#8217;s All</h3>
<p>I suppose it might be a good idea to open up the Help application every now and then, just to see if there are any updates.  But other than that, you can say goodbye to the Help app!</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/903/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=903&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/11/10/get-offline-as3-documentation-in-cs5/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/11/adobe-helpscreensnapz001.png" medium="image">
			<media:title type="html">Adobe Help Preferences: Download Preferences</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/11/adobe-helpscreensnapz002.png" medium="image">
			<media:title type="html">Adobe Help Preferences: Local Content</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Get fl.removeEventListener() to Work</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/11/08/jsfl-get-fl-removeeventlistener-to-work/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/11/08/jsfl-get-fl-removeeventlistener-to-work/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 17:45:50 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=890</guid>
		<description><![CDATA[If you&#8217;ve ever tried to use fl.removeEventListener(), you&#8217;ve probably run into the following situation. Part the First, in which you check the documentation. It reads: Usage fl.removeEventListener(eventType) Parameters eventType A string that specifies the event type to remove from this callback function. Acceptable values are &#8220;documentNew&#8221;, &#8220;documentOpened&#8221;, &#8220;documentClosed&#8221;, &#8220;mouseMove&#8221;, &#8220;documentChanged&#8221;, &#8220;layerChanged&#8221;, and &#8220;frameChanged&#8221;. Returns A [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=890&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to use fl.removeEventListener(), you&#8217;ve probably run into the following situation.</p>
<h3>Part the First, in which you check the documentation.</h3>
<p>It reads:</p>
<blockquote><div>
<div class="section" id="usage">
<h4 class="sectiontitle">
					Usage<br />
				</h4>
<pre>
fl.removeEventListener(eventType)
</pre>
</p></div>
<div class="section" id="parameters">
<h4 class="sectiontitle">
					Parameters<br />
				</h4>
<dl>
<dt class="dlterm">
						eventType
					</dt>
<dd>
						A string that specifies the event type to remove from this callback function. Acceptable values are &#8220;documentNew&#8221;, &#8220;documentOpened&#8221;, &#8220;documentClosed&#8221;, &#8220;mouseMove&#8221;, &#8220;documentChanged&#8221;, &#8220;layerChanged&#8221;, and &#8220;frameChanged&#8221;.
					</dd>
<dd>
<p class="dlseparator">
</dd>
</dl></div>
<div class="section">
<h4 class="sectiontitle">
					Returns<br />
				</h4>
<p>
					A Boolean value of true if the event listener was successfully removed; false if the function was never added to the list with the fl.addEventListener() method.
				</p>
</p></div>
<div class="section" id="descriptions">
<h4 class="sectiontitle">
					Description<br />
				</h4>
<p>
					Unregisters a function that was registered using <code class="codeph">fl.addEventListener()</code>.
				</p>
</p></div>
<div class="section" id="example">
<h4 class="sectiontitle">
					Example<br />
				</h4>
<p>
					The following example removes the event listener associated with the documentClosed event:
				</p>
<pre>
fl.removeEventListener("documentClosed");
</pre>
</p></div>
</p></div>
</blockquote>
<p><em>CS4 documentation can be found online <a href="http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7fae.html">here</a>, CS5 <a href="http://help.adobe.com/en_US/flash/cs/extend/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7fae.html">here</a></em></p>
<h3>Part the Second, in which You Reasonably Assume that the Code Following Would Work</h3>
<pre><code>fl.addEventListener("documentChanged", onDocChange);
function onDocChange() {
	fl.trace("Document changed.");
}
// elsewhere in your script...
fl.removeEventListener("documentChanged");</code></pre>
<h3>Part the Third, in which You Run the Code Preceding and Concordantly Receive the Error Following</h3>
<blockquote><p>The following JavaScript error(s) occurred:</p>
<p>At line 1 of file &#8220;/Users/dru/Desktop/tmp.jsfl&#8221;:<br />
Wrong number of arguments passed to function &#8220;removeEventListener&#8221;.</p></blockquote>
<h3>Part the Fourth, in which You Try to Reason With the Documentation</h3>
<p>So, then you think, &#8220;the documentation is wrong, and we need to pass the listener function in as an extra argument, that must be what this error is about.&#8221;  So you try the same thing, only with this line:</p>
<pre><code>fl.removeEventListener("documentChanged", onDocChange);</code></pre>
<p>Which makes more sense anyway, right?  But&#8230;</p>
<h3>Part the Fifth, in which you Run the Code Preceding and Yet are Still Rewarded With Errors</h3>
<blockquote><p>The following JavaScript error(s) occurred:</p>
<p>At line 1 of file &#8220;/Users/dru/Desktop/tmp.jsfl&#8221;:<br />
removeEventListener: Argument number 2 is invalid.</p></blockquote>
<p>This seems to verify that indeed there are two parameters for <code>fl.removeEventListener</code>, but the second one is <strong>not</strong> the listener function.</p>
<h3>Part the Sixth, in which You Give Up</h3>
<p>You figure it can&#8217;t be the end of the world if you never release your event listeners&#8230;</p>
<h3>Good news!</h3>
<p>After filing a bug with Adobe on this, I got a response stating that the API has changed with Flash CS4, but the documentation was never updated.  Adobe is, according to the email I received, working on updating the docs, but until they do, here&#8217;s the scoop.</p>
<p><code>fl.addEventListener</code> is also mis-documented.  It actually returns a numeric ID, identifying that particular event listener connection.  The mysterious second parameter to <code>fl.removeEventListener</code> is that numeric ID.  Not unlike the old setInterval/clearInterval workflow from pre-AS3 days.</p>
<p>So, this works:</p>
<pre><code><strong>var changeEventId =</strong> fl.addEventListener("documentChanged", onDocChange);
function onDocChange() {
	fl.trace("Document changed.");
}
// elsewhere in your script...
fl.removeEventListener("documentChanged"<strong>, changeEventId</strong>);</code></pre>
<p>Ta-da!</p>
<h3>Personal aside</h3>
<p><em>Honestly, this is a bit disappointing on Adobe&#8217;s part.  It&#8217;s been mis-documented for two major releases of Flash Professional, not to mention that they just willy-nilly changed the API.  Event listening code that works in CS3 does not work in CS4 or CS5, and vice-versa.  On top of that, I feel like the numeric ID aspect is just a bit <em>dumb</em>.  It&#8217;s supposed to be so that it can be utilized from anywhere, as long as you have the right numerical ID, and that makes sense that one script may not have a reference to the actual listener function from another script.  But still.  Maybe a both-techniques-work approach would be useful here.  Let us pick the one that&#8217;s most convenient.</em></p>
<h3>Conclusion, in which You Now Know How to Properly Use fl.removeEventListener()</h3>
<p>You&#8217;re welcome.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/890/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=890&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/11/08/jsfl-get-fl-removeeventlistener-to-work/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Create Exported Classes for Library Items</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/10/22/jsfl-create-exported-classes-for-library-items/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/10/22/jsfl-create-exported-classes-for-library-items/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 19:58:17 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=875</guid>
		<description><![CDATA[OK, here&#8217;s the big project I was working on that prompted the previous two posts on XUL and the SourcePath class. This all stemmed from trying run a project through compc to create a SWC (and asdoc, too). The problem was that quite often we make good use of the exported library symbol. And when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=875&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OK, here&#8217;s the big project I was working on that prompted the previous two posts on <a href="http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/">XUL</a> and the <a href="http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/">SourcePath class</a>.</p>
<p>This all stemmed from trying run a project through compc to create a SWC (and asdoc, too).  The problem was that quite often we make good use of the exported library symbol.  And when you&#8217;re working in Flash, that&#8217;s fine; you just export the symbol and write <code>new SomeLibrarySymbol()</code> in your code, and you&#8217;re on your way.</p>
<p>But the Flex tools seem to know very little about this technique.  Every time it came across <code>SomeLibrarySymbol</code> in my classes, it produced an error.  I figured the only real solution is to create the actual class for <code>SomeLibrarySymbol</code> and then <code>compc</code> would be happy.</p>
<p>Of course, that&#8217;s a tedious process.  Enter JSFL (of course).  I wrote a script that:</p>
<ol>
<li>Presents you with a dialog to choose a source path in which to create classes</li>
<li>Presents you with a prompt to provide a package for the new classes</li>
<li>Loops over your selected Library items and updates the Class with the package</li>
<li>Actually writes out class files to match the item&#8217;s class in the chosen class path</li>
</ol>
<p>It&#8217;s ambitious, and as such I need to qualify that this has worked well for me in my one project, but use with caution.</p>
<p>Code is <a href="http://www.summitprojects.com/resources/download/Create%20Exported%20Classes.jsfl">here</a> and below.  The previously published <a href="http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/">SourcePath class</a> is required.  Sorry I haven&#8217;t made an installer for this, but you&#8217;ll want to drop the class into a &#8220;lib&#8221; folder of your Commands folder, or else edit the first line of the script to point to the right class location.</p>
<pre><code>fl.runScript(fl.configURI + &quot;Commands/lib/SourcePath.jsfl&quot;);
var source = new SourcePath();

var classPathXul = &quot;&quot;;
var classPaths = source.paths;
var iLen = classPaths.length;
for (var i = 0; i &lt; iLen; i++) {
	var cp = classPaths[i];
	classPathXul += &#x27;		&lt;radio id=&quot;&#x27;+(i.toString())+&#x27;&quot; label=&quot;&#x27;+cp+&#x27;&quot; /&gt;\n&#x27;
}

var xul = &#x27;&lt;dialog title=&quot;Select a class path in which to create classes&quot; buttons=&quot;accept,cancel&quot;&gt;\n&#x27;
+ &#x27;	&lt;radiogroup id=&quot;selection&quot;&gt;\n&#x27;
+ 		classPathXul
+ &#x27;	&lt;/radiogroup&gt;\n&#x27;
+ &#x27;&lt;/dialog&gt;&#x27;;

var xulFilePath = fl.configURI + &quot;classpath.xul&quot;;

FLfile.write(xulFilePath, xul);

var classPath = fl.getDocumentDOM().xmlPanel(xulFilePath);

if (classPath.dismiss == &quot;accept&quot;) {
	createClasses(classPath.selection);
} else {
	// Bye.
}

FLfile.remove(xulFilePath);

function createClasses(classPath) {
	var doc = fl.getDocumentDOM();
	var lib = doc.library;
	var sel = lib.getSelectedItems();

	fl.outputPanel.clear();

	var packageName = prompt(&quot;Package name: &quot;);
	fl.trace(&quot;Chosen class path: &quot; + classPath);
	fl.trace(&quot;Package: &quot; + packageName);

	if (packageName) {

		// MAKE FOLDER
		var filePath = source.pathToURI(classPath) + packageName.replace(/\./g, &quot;/&quot;) + &quot;/&quot;;
		FLfile.createFolder(filePath);

		var bmdTemplate = &quot;package &quot; + packageName + &quot; {\n\
\n\
	import flash.display.*;\n\
\n\
	/**\n\
	 * Linked class for library item #ITEM_NAME#.\n\
	 * @class			#CLASS_NAME#\n\
	**/\n\
	public class #CLASS_NAME# extends BitmapData {\n\
\n\
		public function #CLASS_NAME#(w:int, h:int) {\n\
			super(w, h);\n\
		}\n\
	}\n\
\n\
}\n\
&quot;
		var spTemplate = &quot;package &quot; + packageName + &quot; {\n\
\n\
	import flash.display.*;\n\
\n\
	/**\n\
	 * Linked class for library item #ITEM_NAME#.\n\
	 * @class			#CLASS_NAME#\n\
	**/\n\
	public class #CLASS_NAME# extends #BASE_CLASS# {\n\
\n\
		public function #CLASS_NAME#() {\n\
			super();\n\
		}\n\
	}\n\
\n\
}\n\
&quot;
		var template;

		for (i=0; i&lt;sel.length; i++) {
			var item = sel[i];
			switch (item.itemType) {
				case &quot;movie clip&quot;:
					template = spTemplate;
					baseClass = &quot;flash.display.MovieClip&quot;;
					break;
				case &quot;bitmap&quot;:
					template = bmdTemplate;
					baseClass = &quot;flash.display.BitmapData&quot;;
					break;
				default:
					fl.trace(&quot;Problem determining type for item &quot; + item.name + &quot; (type &quot; + item.itemType + &quot;)&quot;);
					continue;
			}

			var baseClass = item.linkageBaseClass == &quot;&quot; ? baseClass : item.linkageBaseClass;

			var className = item.linkageClassName;
			item.linkageClassName = packageName + &quot;.&quot; + className;
			var as = template;
			as = as.replace(/#CLASS_NAME#/g, className);
			as = as.replace(/#BASE_CLASS#/g, baseClass);
			as = as.replace(/#ITEM_NAME#/g, item.name);
			fl.trace(&quot;Symbol: &quot; + item.name + &quot; - Exported as: &quot; + packageName + &quot;.&quot; + className);
			FLfile.write(filePath + className + &quot;.as&quot;, as);

		}
	}
}</code></pre>
<p>Sure makes me wish JSFL/JavaScript had some kind of <a href="http://en.wikipedia.org/wiki/Heredoc">heredoc</a> mechanism.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/875/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/875/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/875/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/875/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/875/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/875/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/875/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=875&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/10/22/jsfl-create-exported-classes-for-library-items/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: A Source Path Class</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 17:10:44 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=872</guid>
		<description><![CDATA[Here&#8217;s a larger part of the bigger project of which I shared a smaller part a few days ago. I seemed to be doing a lot with the source paths (neé class paths), and decided to write a SourcePath class. I don&#8217;t usually bother with classes in JSFL, as Object-Oriented JavaScript is, in my opinion, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=872&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a larger part of the bigger project of which <a href="http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/">I shared a smaller part a few days ago</a>.  I seemed to be doing a lot with the source paths (neé class paths), and decided to write a SourcePath class.</p>
<p>I don&#8217;t usually bother with classes in JSFL, as Object-Oriented JavaScript is, in my opinion, pretty painful.  However, I needed this functionality in a few different scripts and went with a class as being the easiest way to share and encapsulate functionality.</p>
<p>Here&#8217;s a link to the <a href="http://www.summitprojects.com/resources/docs/jsfl/SourcePath.html">documentation</a> (created by making a stub ActionScript class and running it through asdoc).  The basic functions are convenience functions.  You can get the source paths as an Array of individual paths (as opposed to the normal semi-colon-separated String), you can get all source paths available to the document (both the document&#8217;s source paths combined with the application preference source paths), and you can add or remove paths more easily.</p>
<p>The money function is that you can get all of the paths as file URIs if desired.  Assuming your working document is saved, relative source paths will get resolved to relative to the Flash document.</p>
<p>Here&#8217;s the class (available <a href="http://www.summitprojects.com/resources/download/SourcePath.jsfl">here</a>, as well):</p>
<pre><code>/**
 * Provides utility methods and easy access to the source paths available to a given document.
 * A SourcePath, when created, is associated with a specific Flash document.  A given SourcePath
 * object will always hold that document reference.
**/

/**
 * Creates a new SourcePath object.
 * @param	document	The document to associate with this SourcePath object.  If null, will use the currently
 * 						focused document.
**/

function SourcePath(doc) {

	if (!doc) doc = fl.getDocumentDOM();
	this.doc = doc;

	// PRIVATE
	function getFlaDir() {
		var flaPath    = that.doc.pathURI;
		if (!flaPath) return null;

		var flaPieces  = flaPath.split("/");
		flaPieces.pop()
		// This removes the hard drive name from the URI on the Mac
		flaPieces.splice(3, 1);
		var flaDir     = flaPieces.join("/");
		return flaDir;
	}

	var that = this;

	this.flaDir = getFlaDir();

	/**
	 * Gets an Array of Strings defining source paths set in the target document.
	**/
	this.__defineGetter__("docPaths", function(){
		return this.doc.sourcePath.split(";");
	});

	/**
	 * Gets an Array of Strings defining source paths set in the Flash preferences.
	**/
	this.__defineGetter__("appPaths", function(){
		return fl.sourcePath.split(";");
	});

	/**
	 * Gets an Array of Strings defining all source paths available to the current document, both those
	 * defined in the document and in the Flash preferences, in that order.
	**/
	this.__defineGetter__("paths", function(){
		var allPaths = this.doc.sourcePath + ";" + fl.sourcePath;
	 	return allPaths.split(";");
	});

	/**
	 * Returns an Array of Strings defining the source paths, as URIs, set in the target document.
	**/
	this.__defineGetter__("docPathsURI", function() {
		return this.__makeURIList(this.docPaths);
	});

	/**
	 * Gets an Array of Strings defining source paths, as URIs, set in the Flash preferences.
	**/
	this.__defineGetter__("appPathsURI", function() {
		return this.__makeURIList(this.appPaths);
	});

	/**
	 * Gets an Array of Strings defining all source paths available to the current document, both those
	 * defined in the document and in the Flash preferences, in that order.  Source paths are evaluated
	 * as URIs.
	**/
	this.__defineGetter__("pathsURI", function() {
		return this.__makeURIList(this.paths);
	});

	// PRIVATE
	this.__makeURIList = function(pathList) {
		var pathsURI = [];
		var iLen = pathList.length;
		var URI;
		for (var i = 0; i  pathLength) at = pathLength;
		if (at &lt; 0) at = 0;

		paths.splice(at, 0, path);
		this.doc.sourcePath = paths.join(&quot;;&quot;);
	}
	/**
	 * Removes a source path from the target document by the index.
	 * @param	at	The index of the path to remove.
	**/
	this.removeDocPathAt = function(at) {
		var paths = this.docPaths;
		paths.splice(at, 1);
		this.doc.sourcePath = paths.join(&quot;;&quot;);
	}
	/**
	 * Removes a source path from the target document by name.
	 * @param	path	The source path to remove.  If not found, no changes are made.
	**/
	this.removeDocPath = function(path) {
		var paths = this.docPaths;
		var iLen = paths.length;
		var p;
		for (var i = 0; i  pathLength) at = pathLength;
		if (at &lt; 0) at = 0;

		paths.splice(at, 0, path);
		fl.sourcePath = paths.join(&quot;;&quot;);
	}
	/**
	 * Removes a source path from the Flash preferences by the index.
	 * @param	at	The index of the path to remove.
	**/
	this.removeAppPathAt = function(at) {
		var paths = this.appPaths;
		paths.splice(at, 1);
		fl.sourcePath = paths.join(&quot;;&quot;);
	}
	/**
	 * Removes a source path from the Flash preferences by name.
	 * @param	path	The source path to remove.  If not found, no changes are made.
	**/
	this.removeAppPath = function(path) {
		var paths = this.appPaths;
		var iLen = paths.length;
		var p;
		for (var i = 0; i &lt; iLen; i++) {
			p = paths[i];
			if (p == path) {
				paths.splice(i, 1);
				break;
			}
		}
		fl.sourcePath = paths.join(&quot;;&quot;);
	}

	/**
	 * Takes a source path and returns an absolute URI equivalent.  Relative source paths are evaluated against the target
	 * document&#039;s location.
	 * @param	path	The soruce path to evaluate.
	 * @return	A file URI string.  If the input path is relative, the file URI will resolve according to the target document.
	 * 			If the target document is not saved, then a relative input path will return null.
	**/
	this.pathToURI = function(path) {
		//fl.trace(&quot;flaDir: &quot; + flaDir);
		// If flaDir is null, then we can return URI if it&#039;s an absolute path; but otherwise we can&#039;t resolve the path
		// and it&#039;s of no use anyway, so we&#039;ll return null
		//fl.trace(&quot;test: &quot; + evaluatePath(path, flaDir));
		return evaluatePath(path, this.flaDir);
	}

	// PRIVATE
	function evaluatePath(classPath, flaDir) {
		// Always remove the trailing slash, if present.  We&#039;ll add it back in later.
		classPath = classPath.replace(/\/$/, &quot;&quot;);
		if (classPath == &quot;.&quot;) {
			if (!flaDir) return null;
			// We&#039;re on the &quot;.&quot; class path, just concatenate the Flash file directory with the class file path.
			tryPath = flaDir + &quot;/&quot;;
		} else if (classPath.indexOf(&quot;..&quot;) == 0) {
			if (!flaDir) return null;
			// We have a relative path that goes &quot;up&quot; first, so we need to remove
			var cPathPieces = classPath.split(&quot;/&quot;);
			var jLen = cPathPieces.length;
			for (var j = 0; j &lt; jLen; j++) {
				var piece = cPathPieces[j];
				if (piece != &quot;..&quot;) break;
			}
			cPathPieces = cPathPieces.splice(j);
			var tmpFlaPieces = flaDir.split(&quot;/&quot;);
			tmpFlaPieces = tmpFlaPieces.splice(0, tmpFlaPieces.length-j);
			tryPath = tmpFlaPieces.join(&quot;/&quot;) + &quot;/&quot; + cPathPieces.join(&quot;/&quot;);
			if (tryPath.search(/\/$/) == -1) {
				tryPath += &quot;/&quot;
			}

		} else if (classPath.indexOf(&quot;/&quot;) == 0) {
			// We have an absolute class path, so just concatenate it to the class file path.
			if (classPath.search(/\/$/) == -1) {
				classPath += &quot;/&quot;
			}
			tryPath = &quot;file://&quot; + classPath;
		} else {
			// We can assume we have a relative path that does not go &quot;up,&quot; e.g., a &quot;classes&quot; folder in the same folder as the FLA.
			classPath = classPath.replace(/^\.\//, &quot;&quot;);
			tryPath = flaDir + &quot;/&quot; + classPath + &quot;/&quot;;
		}
		return tryPath;

	}

}</code></pre>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/872/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/872/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/872/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/872/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/872/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/872/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/872/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/872/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=872&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/10/11/jsfl-a-source-path-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Kinda-Sorta Dynamic XUL</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 16:34:18 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[JSFL/Extensibility]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=864</guid>
		<description><![CDATA[Here&#8217;s a little snippet for something bigger I&#8217;m working on. The goal of the snippet is to present the user with a choice of available class paths, but the point of this post it to present the underlying technique of using JSFL to gather data dynamically, then create the XUL file, and thus the interface, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=864&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little snippet for something bigger I&#8217;m working on.  The goal of the snippet is to present the user with a choice of available class paths, but the point of this post it to present the underlying technique of using JSFL to gather data dynamically, then create the XUL file, and thus the interface, on the fly.</p>
<p>Here&#8217;s the code, which is fairly self-contained and can be run as is.</p>
<pre><code>function getClassPaths() {
	var doc = fl.getDocumentDOM();
	var classPathsList = doc.sourcePath + &quot;;&quot; + fl.sourcePath;
	var classPaths = classPathsList.split(&quot;;&quot;);
	return classPaths;
}

var classPathXul = &quot;&quot;;
var classPaths = getClassPaths();
var iLen = classPaths.length;
for (var i = 0; i &lt; iLen; i++) {
	var cp = classPaths[i];
	classPathXul += &#x27;		&lt;radio id=&quot;&#x27;+(i.toString())+&#x27;&quot; label=&quot;&#x27;+cp+&#x27;&quot; /&gt;\n&#x27;
}

var xul = &#x27;&lt;dialog title=&quot;Select a class path in which to create classes&quot; buttons=&quot;accept,cancel&quot;&gt;\n&#x27;
+ &#x27;	&lt;radiogroup id=&quot;selection&quot;&gt;\n&#x27;
+ 		classPathXul
+ &#x27;	&lt;/radiogroup&gt;\n&#x27;
+ &#x27;&lt;/dialog&gt;&#x27;;
//fl.trace(xul);

var xulFilePath = fl.configURI + &quot;classpath.xul&quot;;
//fl.trace(xulFilePath);

FLfile.write(xulFilePath, xul);

var classPath = fl.getDocumentDOM().xmlPanel(xulFilePath);

if (classPath.dismiss == &quot;accept&quot;) {
	fl.trace(&quot;classPath.selection: &quot; + classPath.selection);
} else {
	// Bye.
}

FLfile.remove(xulFilePath);</code></pre>
<p>Here&#8217;s the gist.  First, we gather available class paths, both from the application&#8217;s preferences and from the document&#8217;s settings.  Then we loop over those and build up an XML snippet into a String.</p>
<p>Next we use that String in a larger XML structure, the end result being XUL with a radio group, containing radio buttons for each of the class paths.</p>
<p>The last stage involves writing this string to a temporary file, then using that file in the <code>xmlPanel()</code> method.  After the XUL panel is dismissed, we can remove the file.</p>
<p>What I like about this is that it avoids the rather complicated and (in my opinion) messy Flash-to-XUL communication that&#8217;s possible, but requires numerous files and tricky management of passing values back and forth&#8230;something I&#8217;ve never been able to feel very confident about.</p>
<p>Even if you don&#8217;t need dynamically created controls, this is handy for the fact that you can just contain everything in one script.  No separate XUL file that needs to get installed in a predictable location.  Of course, the drawback is that you&#8217;re building XML from within a scripting language, so you&#8217;ve got to escape quotes and all of that.  But consider it another tool (or technique, more accurately) in the tool box.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/jsflextensibility/'>JSFL/Extensibility</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/864/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=864&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/10/01/jsfl-kinda-sorta-dynamic-xul/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Perspective Projection to Control Flash 10 3D Rendering</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/08/25/use-perspective-projection-to-control-flash-10-3d-rendering/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/08/25/use-perspective-projection-to-control-flash-10-3d-rendering/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 23:24:18 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=846</guid>
		<description><![CDATA[I recently ran into an issue where I was working with a full-window Flash piece and using native 3D rendering. I&#8217;ll encapsulate the problem with the following example. Just copy and paste the following code into a new Flash file: var container:Sprite = new Sprite(); addChild(container); for (var i:uint = 0; i &#60;= stage.stageWidth / [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=846&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently ran into an issue where I was working with a full-window Flash piece and using native 3D rendering.  I&#8217;ll encapsulate the problem with the following example.  Just copy and paste the following code into a new Flash file:</p>
<pre style="width:500px;overflow:auto;"><code>var container:Sprite = new Sprite();
addChild(container);

for (var i:uint = 0; i &lt;= stage.stageWidth / 50; i++) {
	var s:Shape = new Shape();
	container.addChild(s);
	s.graphics.beginFill(0, 1);
	s.graphics.drawRect(-100, -100, 200, 200);
	s.x = i * 50 - (stage.stageWidth / 2);
	s.rotationY = 90;
}

onResize(null);
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, onResize);
function onResize(e:Event):void {
	container.x = stage.stageWidth / 2;
	container.y = stage.stageHeight / 2;
}</code></pre>
<p>Run it, and you&#8217;ll see something like the following:</p>
<div id="attachment_854" class="wp-caption alignnone" style="width: 500px"><a href="http://summitprojectsflashblog.files.wordpress.com/2010/08/flashscreensnapz002.png"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/08/flashscreensnapz002.png?w=490&#038;h=375" alt="Result of the above code" title="PerspectiveProjection Vanishing Point" width="490" height="375" class="size-full wp-image-854" /></a><p class="wp-caption-text">Result of the above code</p></div>
<p>Now, resize the stage.  As you stretch it around, you&#8217;ll see the row of squares move around.  However, you might notice that the vanishing point of the 3D scene remains fixed.  This might not be what you want:</p>
<div id="attachment_853" class="wp-caption alignnone" style="width: 500px"><a href="http://summitprojectsflashblog.files.wordpress.com/2010/08/flashscreensnapz001.png"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/08/flashscreensnapz001.png?w=490&#038;h=420" alt="The vanishing point doesn&#039;t move with with objects" title="PerspectiveProjection Vanishing Point" width="490" height="420" class="size-full wp-image-853" /></a><p class="wp-caption-text">The vanishing point doesn't move with with objects</p></div>
<p>The vanishing point is controlled by an instance of the PerspectiveProjection class.  This class (<a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/">docs here</a>), has very few properties and methods, but what it does offer is a way to set the vanishing point through a property called <code>projectionCenter</code>.  This is a Point object that determines how the 3D projection orients itself.  What we want to do is update this value as we resize the stage, so that the vanishing point remains in the center.</p>
<p>If we update the previous code to this:</p>
<pre style="width:500px;overflow:auto;"><code>var container:Sprite = new Sprite();
addChild(container);

for (var i:uint = 0; i &lt;= stage.stageWidth / 50; i++) {
	var s:Shape = new Shape();
	container.addChild(s);
	s.graphics.beginFill(0, 1);
	s.graphics.drawRect(-100, -100, 200, 200);
	s.x = i * 50 - (stage.stageWidth / 2);
	s.rotationY = 90;
}

<strong>var pp:PerspectiveProjection = this.transform.perspectiveProjection;</strong>

onResize(null);
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, onResize);
function onResize(e:Event):void {
	container.x = (stage.stageWidth) / 2;
	container.y = (stage.stageHeight) / 2;
	<strong>pp.projectionCenter = new Point(container.x, container.y);</strong>

}</code></pre>
<p>By updating the <code>projectionCenter</code>, we update the vanishing point.</p>
<p>The other interesting thing about the PerspectiveProjection (aside from the other properties like <code>fieldOfView</code> and <code>focalLength</code>) is that each DisplayObject can have its own.  Essentially, a given DisplayObject will use the PerspectiveProjection found in the most direct parent of that object.  By default, the root display object is the only one with a PerspectiveProjection set up, and it&#8217;s <code>projectionCenter</code> is set up at the center of the stage when the movie is initialized.</p>
<p>If you explicitly create a new PerspectiveProjection object on the <code>transform</code> property of a DisplayObject, it and any of its children will then use that object and not the root one.  This technically allows you set up multiple vanishing points.  I won&#8217;t create an example of this, as Flash &amp; Math has <a href="http://www.flashandmath.com/flashcs4/pp/index.html">put up a nice example already</a>, which also details some of the behavior of the the PerspectiveProjection object more than I have here.</p>
<p>I thought this was worth mentioning, though, in that everyone knows you can now set the z or rotationY properties of DisplayObjects, but some of these less obvious techniques might need some explanation.</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/846/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/846/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/846/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/846/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/846/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/846/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/846/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/846/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=846&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/08/25/use-perspective-projection-to-control-flash-10-3d-rendering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/08/flashscreensnapz002.png" medium="image">
			<media:title type="html">PerspectiveProjection Vanishing Point</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/08/flashscreensnapz001.png" medium="image">
			<media:title type="html">PerspectiveProjection Vanishing Point</media:title>
		</media:content>
	</item>
		<item>
		<title>TextMate: Open FLA from Document Class</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/08/24/textmate-open-fla-from-document-class/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/08/24/textmate-open-fla-from-document-class/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 22:13:51 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=839</guid>
		<description><![CDATA[It&#8217;s kind of opposite-world time from my last post. Here&#8217;s the deal: I&#8217;m in TextMate, and it&#8217;s super-easy to open up a text file with Command-T and a little bit of typing. So I can find a given document class easy enough. But finding the corresponding FLA file is less easy. Even though I tend [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=839&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s kind of opposite-world time from <a href="http://summitprojectsflashblog.wordpress.com/2010/08/23/jsfl-open-document-class-in-textmate/">my last post</a>.  Here&#8217;s the deal: I&#8217;m in TextMate, and it&#8217;s super-easy to open up a text file with Command-T and a little bit of typing.  So I can find a given document class easy enough.  But finding the corresponding FLA file is less easy.  Even though I tend to open up the entire project in TextMate, and can find the FLA in the project drawer, it doesn&#8217;t show up in the Command-T file list because it&#8217;s treated as binary.  So, in a large and complex project, that means a minute or so of digging through folders until I get to the FLA, and can open it.</p>
<p>Then my recent <a href="http://summitprojectsflashblog.wordpress.com/2010/08/23/jsfl-open-document-class-in-textmate/">&#8220;Open Document Class in TextMate&#8221; JSFL script</a> left me wondering if I could do something similar for FLA files from an ActionScript file&#8230;and it turns out, I can!  I mean, duh, or else you wouldn&#8217;t be reading this, right?</p>
<p>Anyway, there&#8217;s a bit of manual labor involved with this technique, but once you have it set up, opening up the FLA file also becomes super-easy.  Here&#8217;s how I do it:</p>
<pre style="overflow:auto;width:500px;"><code>/*
ruby -e '`open #{ARGV[0].split("classes")[0] + "flas/global/modules/toutgroups/ToutbarModule.fla"}`' $TM_FILEPATH
*/</code></pre>
<p>I also usually precede that line with directions, because it&#8217;s very unclear what&#8217;s going on here:</p>
<pre style="overflow:auto;width:500px;"><code>/*
<strong>To open the related FLA, place your cursor on the next line and press Control-R:</strong>
ruby -e '`open #{ARGV[0].split("classes")[0] + "flas/global/modules/toutgroups/ToutbarModule.fla"}`' $TM_FILEPATH
*/</code></pre>
<p>So, if you didn&#8217;t know, TextMate binds Control-R to an action that execute the text of your current line as a shell command.  In other words, you can run Terminal commands from right within your TextMate document.</p>
<p>Now, the command itself does a bunch things at once.  First, there&#8217;s this:</p>
<p><strong>ruby -e</strong></p>
<p>This runs the remainder of the line through the ruby interpreter.  The &#8220;-e&#8221; flag lets us run a string directly as ruby, as opposed to pointing to a ruby file.  I&#8217;m sure this logic could be accomplished without Ruby and plain old bash, but I&#8217;m much more comfortable with ruby, so there.</p>
<p>The bit between the single quotes is the ruby &#8220;program&#8221; itself.  We&#8217;ll get back to that.  The final part,</p>
<p><strong>$TM_FILEPATH</strong></p>
<p>Is a shell variable set up by TextMate, and is the absolute path to the current file, which we want to use in our ruby program.  However, we won&#8217;t have access to it from within the ruby program, so we evaluate in the shell, and then pass it into the ruby program as an argument.</p>
<p>So, the ruby program take that argument (ARGV[0]) and gets the path to our project folder by splitting it at the word &#8220;classes.&#8221;  You&#8217;ll want to modify this value depending on how you set up your projects.  Then we tack on a path relative, starting at the project directory and then going to the Flash file in question.  The result is an absolute path to our FLA.  The result, after Ruby gets done processing the strings, is simply:</p>
<p><strong>`open /Path/to/some/file.fla`</strong></p>
<p>Which goes back to the shell to open up the file.</p>
<p>So for this to be useful to you, you will need to update the string that is used in the split, and obviously type in the correct path to the FLA.  It&#8217;s a bit convoluted, but it&#8217;s more portable than a hard-coded absolute path.  And once it&#8217;s set up and working, then it&#8217;s very easy to run.</p>
<p>To make it easier to get set up in the first place, I wrote a TextMate snippet:</p>
<pre style="overflow:auto;width:500px;"><code>To open ${2:the} FLA, place your cursor on the next line and press Control-R:
ruby -e '\`open #{ARGV[0].split("classes")[0] + "flas/${1:${TM_FILENAME/\.as//}}.fla"}\`' \$TM_FILEPATH</code></pre>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/839/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/839/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/839/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/839/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/839/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/839/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/839/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=839&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/08/24/textmate-open-fla-from-document-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Open Document Class in TextMate</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/08/23/jsfl-open-document-class-in-textmate/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/08/23/jsfl-open-document-class-in-textmate/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 17:11:56 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=831</guid>
		<description><![CDATA[So, posting recently that Earl has left us made me realize that we haven&#8217;t posted anything since Amos left us a few months ago. I decided that today I would post something of use. In my efforts to cut down on manual mundane tasks, I whipped up this little JSFL script. It takes the document [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=831&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, posting recently that <a href="http://summitprojectsflashblog.wordpress.com/2010/08/20/earl-earl-earl/">Earl has left us</a> made me realize that we haven&#8217;t posted anything since <a href="http://summitprojectsflashblog.wordpress.com/2010/05/12/bye-bye-amos-bye-bye-happiness/">Amos left us a few months ago</a>.  I decided that today I would post something of use.</p>
<p>In my efforts to cut down on manual mundane tasks, I whipped up this little JSFL script.  It takes the document class of the current Flash document and opens it in TextMate.  A few caveats:</p>
<ol>
<li>This has been working for me the few times I&#8217;ve tried it out, but I&#8217;m pretty sure it will fail in other use cases.  For instance, we typically have relative paths set up per document that tend to go &#8220;up&#8221; (e.g., &#8220;../../classes/&#8221;), so that&#8217;s what I&#8217;ve tested the most.  Absolute paths or relative paths that don&#8217;t go &#8220;up&#8221; haven&#8217;t been tested, but I tried to flesh out the logic.</li>
<li>It relies on <code>FLfile.runCommandLine</code>, which, <a href="http://summitprojectsflashblog.wordpress.com/2009/03/09/copy-directories-with-jsfl-take-2/">as discussed earlier</a>, isn&#8217;t supported officially, so there&#8217;s that.</li>
<li>Being that it opens the file in TextMate, this isn&#8217;t really suitable for Windows machines.  And also, Macs that don&#8217;t have TextMate installed.</li>
</ol>
<p>I won&#8217;t discuss the logic here – it&#8217;s nothing terribly innovative – I just thought the idea was neat and it was something to share.  As always, please feel free to send back suggestions, additions, or corrections.</p>
<p><a href="http://www.summitprojects.com/resources/download/OpenDocumentInTextMate.zip">Download here</a></p>
<p><a href="http://www.summitprojects.com/resources/download/OpenDocumentInTextMate.jsfl">Source code</a>:</p>
<pre><code>
var doc        = fl.getDocumentDOM();
var theClass   = doc.docClass;
var flaPath    = doc.pathURI;
var flaPieces  = flaPath.split("/");
flaPieces.pop()
// This removes the hard drive name from the URI on the Mac
flaPieces.splice(3, 1);
var flaDir     = flaPieces.join("/");
// Get a list of all classpaths, both set in the document and in the Flash preferences (semi-colon-separated)
var classPathsString = doc.sourcePath + ";" + fl.sourcePath;
var classPaths = classPathsString.split(";");

// Translate class name to file path.
var classFile = theClass.replace(/\./g, "/") + ".as";

// Loop over all of the possible class paths and look for a matching file.
var iLen = classPaths.length;
var tryPath;
for (var i = 0; i &lt; iLen; i++) {
	tryPath = null;
	var cPath = classPaths[i];
	if (cPath == &quot;.&quot;) {
		// We&#039;re on the &quot;.&quot; class path, just concatenate the Flash file directory with the class file path.
		tryPath = flaDir + &quot;/&quot; + classFile;
	} else if (cPath.indexOf(&quot;..&quot;) == 0) {
		// We have a relative path that goes &quot;up&quot; first, so we need to remove
		var cPathPieces = cPath.split(&quot;/&quot;);
		var jLen = cPathPieces.length;
		for (var j = 0; j &lt; jLen; j++) {
			var piece = cPathPieces[j];
			if (piece != &quot;..&quot;) break;
		}
		cPathPieces = cPathPieces.splice(j);
		var tmpFlaPieces = flaPieces.concat();
		tmpFlaPieces = tmpFlaPieces.splice(0, tmpFlaPieces.length-j);
		tryPath = tmpFlaPieces.join(&quot;/&quot;) + &quot;/&quot; + cPathPieces.join(&quot;/&quot;);
		if (tryPath.search(/\/$/) == -1) {
			tryPath += &quot;/&quot;
		}
		tryPath += classFile;

	} else if (cPath.indexOf(&quot;/&quot;) == 0) {
		// We have an absolute class path, so just concatenate it to the class file path.
		if (cPath.search(/\/$/) == -1) {
			cPath += &quot;/&quot;
		}
		tryPath = cPath + classFile;
	} else {
		// We can assume we have a relative path that does not go &quot;up,&quot; e.g., a &quot;classes&quot; folder in the same folder as the FLA.
		// Take the fla directory and concatenate the classfile, but remove the possible &quot;./&quot; at the front of the class path.
		cPath = cPath.replace(/^\.\//, &quot;&quot;);
		tryPath = flaDir + &quot;/&quot; + cPath + &quot;/&quot; + classFile;
	}

	if (FLfile.exists(tryPath)) {
		tryPath = tryPath.replace(&quot;file://&quot;, &quot;&quot;)
		FLfile.runCommandLine(&quot;mate \&quot;&quot; + tryPath + &quot;\&quot;&quot; );
		break;
	}

}

</code></pre>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/831/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/831/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/831/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/831/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/831/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/831/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/831/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=831&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/08/23/jsfl-open-document-class-in-textmate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>Earl, Earl, Earl!</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/08/20/earl-earl-earl/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/08/20/earl-earl-earl/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:00:32 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=822</guid>
		<description><![CDATA[Dagnabit, we seem to be losing Flash developers. We&#8217;ve checked behind the sofa (because that&#8217;s where you look when you lose things), but Earl Swigert, fellow ActionScripter here at Summit, is moving on to other things. See ya, man. Earl worked for us for two years or so. I first met Earl when he was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=822&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Dagnabit, we seem to be losing Flash developers.  We&#8217;ve checked behind the sofa (because that&#8217;s where you look when you lose things), but Earl Swigert, fellow ActionScripter here at Summit, is moving on to other things.  See ya, man.</p>
<p>Earl worked for us for two years or so.  I first met Earl when he was a student at the Art Institute of Portland, and even then he was blowing away his peers with his comprehension of programming concepts.  We quickly hired him as an intern, then part-time, and eventually full-time.  But Earl found a job that will let him make games as well as head up a team of ActionScripters, both of which he is well-suited to do.  We&#8217;re very sorry to lose Earl, but we&#8217;re happy for the opportunity for him.</p>
<p>Godspeed, Earl.  We will missing singing your theme song:</p>
<span style="text-align:center; display: block;"><a href="http://summitprojectsflashblog.wordpress.com/2010/08/20/earl-earl-earl/"><img src="http://img.youtube.com/vi/rF2z3XRUD6k/2.jpg" alt="" /></a></span>
<p><em>Note that we sang it as &#8220;Earl, Earl, Earl,&#8221; not &#8220;Girls, girls, girls.&#8221;  Just in case you thought Earl was a womanizer.</em></p>
<p>In <strong>completely unrelated</strong> news, we&#8217;re looking for a Flash developer&#8230;</p>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/822/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=822&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/08/20/earl-earl-earl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>Bye Bye Amos.  Bye Bye Happiness.</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/05/12/bye-bye-amos-bye-bye-happiness/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/05/12/bye-bye-amos-bye-bye-happiness/#comments</comments>
		<pubDate>Wed, 12 May 2010 16:44:12 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=811</guid>
		<description><![CDATA[Hello loneliness, I think I&#8217;m gonna cry. Amos Lanka, Flash Developer extraordinaire, has left us. Amos was instrumental our recent Nike Golf redesign (oh, yeah, by the way, we launched a redesigned nikegolf.com&#8230;sorry for the belated notice, we&#8217;ve been pretty busy lately), and has grown in leaps and bounds in the over two years. We [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=811&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello loneliness, I think I&#8217;m gonna cry.</p>
<p>Amos Lanka, Flash Developer extraordinaire, has left us.  Amos was instrumental our recent Nike Golf redesign (oh, yeah, by the way, we launched a redesigned <a href="http://www.nikegolf.com">nikegolf.com</a>&#8230;sorry for the belated notice, we&#8217;ve been pretty busy lately), and has grown in leaps and bounds in the over two years.</p>
<p>We wish you the best of luck at his new position with Struck/Axiom.  We will miss your bearded mumbling and your Colbert obsession.</p>
<p>Goodbye, king of ASCII art.</p>
<pre>OOZOZZZZ$7OOOZOO7$7ZZZZOOZZ$7$Z$$ZZ7$ZZOOOZ7$Z$$7777$$7777ZZZ$Z$II~~~~~~:::::::,,,,,,,,,,,,.............................
$$ZZOZZZO$$ZZZZZ7Z$$77$ZOOOZ$$7$77$$Z$ZZOOOZOZZ$$$7$7Z$$77$Z$7Z$$7I+=~~~:::::::::,,,,,,,,...............................
$7$ZZOOOZZZOO$$$7$$77ZZ7ZZZZ7$$$7$77$ZZZ$O$ZOO$77$ZZOOZZZOOZOO8OZOZ?I?7+~::::::,,,,,,,,,,,..............................
ZZZOZ7$Z$ZOOOZO$7$Z77Z$$Z$$$$7$7Z$7I$$$ZO$$ZO$$$7$ZO888DDDD8D8DDDD88O8Z$I=~:::::,,,,,,,,,,..............................
$ZOOOOZZ77OZOOOOOZ$$7$$ZZ$$$$77Z$$7$$7Z$$$ZZ$ZOO8O88DDDDDDDDDNDDDDDNDDN8O7I=~::::,,,,,,,................................
$7ZZOOOOOO$7ZOZOOOO8O$I7$$$Z$$7$$$$7OOO$$ZZOOO88DD8DOOZO88DDDDDDNNNDDDDDDD8Z7+~::::,,,,,,,,.............................
$77$ZZZOOOZZZ$ZZZOOO88O$7ZZ$7$$$$$I7$ZOOOOOOO888D8OZ777$ZO88DDDNNNNNDNDDNDND8ZI~:::,,,,,,,,.............................
$ZO7$7ZZOOOOOZ$$7$OOZOO$$$77Z$$$$$777$ZOO8OZO8DDO$7???II77ZZO8DDNNNNNDDDDNNNND8$I=::::,,,,,,............................
OZZ$ZZZ77$ZOZOOO7$Z77$Z7O$7OO$$777$$ZZZ888O8DDO$??==++III77$ZOO8DDNNNNNDNDDNNNNDDOZI+~:,,,,,,,..........................
ZZZOZZZO$$7$Z$OZ7ZZ$Z$$7OOZZOOOZ7I$7ZO8D888DO7I++==++I?I?I77$$ZOO8DDNNNNNNNDNDNDDDOZ?+=:,,,,,.,.........................
7$$$ZZOZ78OZ$7$O$7ZOO$ZZ$$ZOZZOOOZ$7$ZOD8D8$I+++==++????IIII7$$OO88DDNNNNNDNNNNNDNDO$?=~::,,,,,,........................
ZOO$77ZZZZO8OZOOO$ZZZZOOOOZZZZ$$88Z$$ZODNN7?===+=~==+++?III777$Z888DNNNNNNNNNNNNNNDD8$?=~::,,,,,,.......................
OOO88O$77OO8OOOOOO8$$ZZ$ZOZOOZ7$OZ$$888NNZ++===~~~==+++??I7I$7$$ZO8DDNDDNNNNMNNNNNNND87=~~:::,,,,,,,....................
OO88O8O8OZ$OOZZZOOOOOOZ$ZZZZOO$OO$$ZZ88NNI=~~==~~=+???777$$Z$777$ZO8DNNNNMMMMNMNNNNNND8$?=~~~:::,,,,,...................
7ZZOZZOOOOZZZZ7ZZZOOOOZZO8ZZZ$788ZOZZ88NN?~~~~=~=+I$ZO8OZZZ$$$777$ZO8DNNNNNNNNNNNNNNNNNDZI+~~~::::,,,,..................
$$II$ZZZOOOO8OZ$$$ZZOZ$$OOOOO$IOZOOOOO8NN=~~==++I$ODD8OZZ$ZZ$7I7777$Z8DNNNNMD8DNNNNNNDNDD8$I+~~~:::,,,,,,...............
77$ZOZ777$$$OOZ$8OOOOOZ77$OOO87Z$ZZ$O88D8==+=?I$Z8888888O$OOZ77II777$$O8DNNN8D8NNNNNNNDDDDZ$$I=~~~~:,:,,,,..............
$77$ZO$ZZ$77$ZZ$OOO8O8OO$7$ZZOO$ZO7I$$ZN$?777$7$ZOOO88Z8O$Z$$77IIII7$$ZO8888DD8NNNNNNNNN888OZZ7I+~=~::::,,,,............
$$$$ZO$ZZZ$Z$7I7OZ$ZOOOOOZ$$7$$ZOZZ7$$$8ZO8OOZI?7$$OOZZ$$777IIIII7I7$7ZZOOO8D8DDDNNMNDNDD88DZ$Z$7?==~~~::,,,,,..........
$77$$ZI7$$$$ZZZ$Z7$$ZZZOOOOO7$77$ZZIOO8D8ZO88O~+I77Z$77IIIII?IIIII7$$7$OOOZO8O8DDNNMNNNNNZZDO$Z$7$7I+==~~::,,,,,.,......
ZOOOO$77$$$$$ZZ$$$$Z$IZ$ZZZO$$ZOZ$$7$Z8DDZ88OI~I7I777II??II?III7777$7$Z888888ODDNNNMNNNNNDO88$7II7$$7I++==~:::,,,,,,...,
Z888OOOOO$7$$Z7$$7$$$7Z$$$OZ77ZOOZZZ$ZDDDD8OZ+=?I7IIII?????II7777$$$$ZO8888OOODNNNMNNNNNNNOO8O777II7777I?++=~~~::,,,,,,,
7OO8OOOOOOOOO$7I$77$Z$OOOOO$7IZ$$ZZOZO8DDDD$7~+I77777III?III777777$$$OO8DD8D8DNNNNMMMNNNNDO7Z8$$777777$Z7III?+==~~::::~~
I?7$ZZOOOOOOZ8O$$$7Z$7ZOO8OZZZ$7$$$$ZD8NDDMI?=?7I7I777IIIIII777$77$$OO8DNNDDNNNMNNMMNNNMNNO7O8$7777ZZ7ZZ8ZZZ$$$7777II7II
++?7I7$ZZZZOOO8$7OZZZ77ZZZZZ$OZZ$III$DZNNDN?+?77ZZ7$$7II7II7I77777$ZO8DDDDNNNNNMNNMNNNNNNND8887$777$O$$ZZOO8OOOZZ$Z$7777
??+?$77ZZ$7$ZZZ$7ZZ$$$$7$$$$7$ZZO?7$$8$NDOMI+IZO88OOZ7II777777777$ZZO8DDDNNNNNNMNNNNNNNNMND8O8ZZZZ77$$$77$ZOOOZZZZ$$777I
$IIIO$$ZZ7$ZZ$777ZZZ$77$77Z$I?7$7I7Z$DZN88MZ+?ZO8OOZOZ$$$$$$$$77$ZOO88DDNNNNNNNMNNMNNNNNNNDD87$OZZ$$7$Z$$$ZZOOZZZZ$77III
7Z$$Z$$ZZ$$$Z$ZZZZ$77777$$$Z$I$7I77$$NOD8DNN7?ZO88OOOOOZOOZ$$$$$OO88DDDDNNNNNNNNNNNNNNNNNNNN$,,:~Z$OOZ$7ZZ$OOZZZZZ$$II7I
OZO$77I$ZZZZZZZZZZZZ$777Z77$$$$ZZ$$7$DONODND8?$8O888888OOO8OZZOO8DDDDDNNNNMMNNNMNNNNNNNNNNND7,...:IO$$ZZ7$$OOZO$$$$77?II
OZZZZOOI77$ZZZZZ$ZZZ$$OZO$7$$77$$$$$ZNZDZDN8D7$88OOOOZOOOO888O88DDDNNNNMNMMNNNNNNDNNNNNMNNDDZ:,,..,~7Z$ZOZZZOZZ$$7$77II?
OZZZZZ$$$ZZ$Z$I7$$Z$$ZOOOOZOZ$$77777$D$D$DDOZ$ZDZZO8OZOOO8DD88DDNNNNNNNMNMMMMNNNNNNNNNNNNNN8O=...,..,:II7$ZOOZ$Z777II?II
IZZZZOOZZZOOZZ$7$O$$$$Z$ZOZZZZZZ$+?II8$D$DNZZOZO$Z8D88888DDNDDDNNNMNNMMMMMMMMNNNMNNNNDDNNNDZ7?,..,,,,,:I~~7OOZZZ$7III???
7I7II$Z7$$ZZOOZ$ZOZZZ777$$$$ZZZZZI+?$Z$8ZDDO8OZZ$O8DDDNNNNNNNNNNMNMMMMMMMMMMNNNNMDDNNNDN8DDZ$8~,,.,,,,:7~,:=$ZZ$77II????
ZZZ$$7IIIII77$$7ZOZZOZ7$Z$I?I$$$$?I?$$ZOODN88ZZZO8NNDNNNNNNNNNNMMMMMMMMMMMMNNNNMNNNNNNNNNNZZZ7:,,,,,,,:I~,:~=I$7III?++++
ZZZZO$I77$Z$77II7$$$ZZ$$Z$$7IZ7III$7Z$$O8DDDD8888DNDNNNNNMNNNNNMMMMMMMMMMMMNNNNMNDDNNNNNDO==88?....,,,=+,::~I77I????+=++
Z$OOOO??ZZZZZ$7$I777$$I7$Z$$7ZZ$$7I787Z8DD8N88D8DNNDNNNMNNMNNMMMMMMMMMMMMNNNDNNMNDNNNNNDDD=,8$:,.....,+~,::~I7II?+++====
Z$7$$$I+IZZOZZ$7$$$Z7$III7III7$OZZ7$8$OD8N8N888DNNNNNMNNNMMMMMMMMMMMMMMMNDNDNNNMNDNNMNDN88$+,7.......,,.:::~II??++======
OOOZZ$7II77$$$$ZZOZZO$?7Z$7IIII777I78ODNNDDN8DDDDNNNNMNNNMMMMMMMMMMMMNMNDDDDDDNNNDNNNNNND8O$$Z......,.....,~??++=~====~~
OOOOOOZZZZZ$IIIII7$$Z7++$$$$$$$7I7+788DDNNNNNNNNDNNNNNMMMMMMMMMMMMMMNNNDDDDDDDNNNDDNNDNND888D8~.............~===~~=~~~~~
O8O8OOZOZ888Z7ZZ$$II77?+7$$$$$$Z$ZI7DONDN8NNDDDNNNNNNNMMMMMMMMMMMMNNNDD8888DDDNNNDDDNDNNDD88888$==~.........,:~~~:~~:::~
I$$OOZZOZZ88$Z$O$ZZ$Z$$I??I777777Z7O88NDNDNNDNNNNNNNMMNNMMNMMNMMNMNDDD88O888DDDNNDDDDNNNNDDDOO8OZO77.........,:::::::::~
Z$77I7?I$$$$77O$Z7$$$$ZZ7Z7??=??III8ODNNN8MNDNNNNNNNMMNMMMNMNNNNDD888OOO8O8DDDDDD8DDNNNNNNNDOO8OZ$777I+:......:::::::::~
ZOZOOZO7ZIII???7I77$$ZZZZZ$II++??$$8DONNN8NNNNNNNMNMNNNNMMNDDD888OZZZZZZZZ8DDD8DD8DNDNNNNND8ZZ8O$7777I?+++~,,,,::,,,....
ZOOO$ZZZOOZO$Z$77II7II777$ZI$Z$$7$O888NNND8DNNDDNMNNMMNNNMMD8ZOZZOZ$$$$Z$88DND8D88DNDNNNNDD8OOOO$$77II+?+=+===~:,,,.....
ZZZOZ7$ZZZZZZZZOZZ$Z$I777I7IIIII7ZODONDNNDD8NNDNDNMMMNND888NDO$$Z$$7$7$$ZO8DD8OD88NDDNNNDDD8OOO$$77II?+?++===+++=:,.....
II7I$7+I$$ZZOZZOZZO$ZI7$$$7$$$$77O8ZONDNDNNON8NNNMMMNDDN8O$$ODO$$$77777$Z88DDOODOODNDNNND88888ZZ$7III???+++===++==:.....
Z$Z$$$7IIII$ZZ77II$$Z$$777I7I77$$DOZ8NDNDNN8DDNDMMMND8D8ZZ7I+$DZZ77II7I$OO8DOZ8DOODDDNDDD8888OZ$7II???+++++++===+==.....
ZOZZ$$ZOZZ$$OOO$77II$$777III7$$$$D$ZDDDNDDNN8NDDNMNDOODZ7II++?ZOZ$7III$OOZOOZ888ZODDDDDDD8O8OO$$I????+++++++++==+==~....
ZZOOZZZOZZOZOOZ7I77$Z$$$7$?+I7IIZ8$ZDDD8D8N88NDNNNDOZ$DZ??7+=+IOZ$I??$ZOZ$Z$O88OZ8DD8DDDDOOOO$$I????++++++++++++===~~...
$$$Z$$ZZZZOO$7$$II77$77Z$Z?+$7IIOO$ZDDD8NDDD88NNNNO$$ZDZ=?I?7?+ZZ7II$ZZ$$$7Z88OOZO8D8O8DDOOZZ$I????++==++?++=+++====~:..
III++IIIII77777777777$7Z$77=I$7IZO$ZDDDODNND8DNDDO$I7Z8$=I?IZI+$O$I7$Z$7I7$88ZI$ZO888OO88OZZZI???+++++??+?+++++==+==~~:.
I7??7$$$$$$I7?III7777I7I7I?+?I7$OZ?$888ODNDD88888$7IIZOI+++~=++78777I????$O8ZI7$ZO8DDOOOOOZ$7????++++?????+++++++++====,
I7$I7$Z$$ZZ$Z7II?+??I7IIII?==++IZ7=7O78OD8OZOOOZZ7I?IZOI?+=~=+++$I??++=??$O$?+I$OZO8OZZ$Z$$$I????+++??????++=+?++++=~==~
ZZZI$$$ZZZZ$$7$7777+7$$7$7$I????Z+~Z87OODD$IZZZZII??7$$I?=====+++++=++?IZZI+++$OZZ8ZZZ$$7777+??I?++++?????+=++??+++====~
7I7I?I7777$$7I7III??I77$7$7777I7Z+~$ZZ8O887?$ZZ7??+?7$7?+~====+==+++=??Z$I++=?$Z7OO$$777II???+?II++?I?I?+++++++++++==~~~
7III?7IIII?7777II?+?=+++III7III77==7Z$78OOII$Z7I?=+?7$I=?+=+++===++=+IZ$++==+I7OZO$77III??+++?III++I77???+++++++++====~=
??7Z$$$$$7$$ZZOOOO$I?IIII+?I??++?~?7Z7Z8ZZI?$7??+==+7$+~=?~++====+++IZ7I=+==?I$OZ7IIII????+++?I7?+?777I???+++++?++======
7I$ZZZZ$Z$7$$O8OZOO$I7$Z$I$$Z77II:?$$$8OZ$I?7??+==++77~~~?~+?===?++7$ZI+=++?I77Z7?????+++++=?III?++7$III?+++??+++?+=====
IIIZOZZZZZ7I$$OOZOZZZZZZZI7$$$Z$I:=$$Z$$$$$???++=++=I7~:~?===+=+???$Z7?++==+??I$I++=++===+++?IIII++$Z7II?????+?+???+==~~
?III$Z$$7$7+?+?IIII??I7II?IZ$$$Z+:~II$II$$$?++=~=+++?I~:=+=~+?????7$7+======+II?+===++==++=+??I?++?7$$7I+??+?????++===~~
$77?7OZZ$777?II$7I7??IIIII?=+??++:~+IIII7$I+++~~~=+?++~~+?=~??7III7I+~=+===~??I+====+===+?=??I??+=+7OZ7?+?????+??++===~~
Z$ZIIZ$$$$7$I$ZZZZZZI$7I7$$I$ZZZ+~==7?777I==~~:::=:==++~??~+7O8Z??I====+===++?+========++?++?I?++++$OOI?????I???+??I+===
$$Z$7$Z$$Z$ZI$O$Z$$$I7III777ZZZZ=:==??7IZ=~::~:::::~IO+=++~+?$7I+I+====+===++?++==++=++?????I?????+$87????II??I?I?+++===
Z$77I777I777I7ZZ$$$7I7I?I7I7OZZZ=~I+??7$7Z~:::,::~~=ZZ+===~++++++I=~==+==+????+==+++++=???????++++?$$I?I7IIII???+==+====
IIIIIIIII7?IIII7IIIII????7??+??=~~I?I+IO7Z~:::::~=+7$7===~=++?+++?=~==?=~=+I?+=======+++++=++++++?7Z$IIIII??+++++++==+==
$$$$$$$$7ZZ$ZZ7$77IIII??I777$$$=:~?I7+7+=::::::~?7$7II=~=~~~==+=?I~=+++=~==I?+=======++?++++++=+++$8Z7I7????++++?+=+===+
$ZZZZ7$ZZZ$$ZZ$$7777$77II7$Z$Z7~:~7Z$+7+=~+$???IIIII??~~~~+=+=~~I?~=?++==~=+II+===+I=+????+++==++?$8O$777?++++++++=+=+==
ZOZZZ$7$ZZ7$Z$ZZ$7777$77$78Z$$=:::7Z$7I~:~I+~===?I???+~~~=+=++=+I?=??++?=~==+I?==?$Z7??+?===+=+++I$8OZ$I7I?+++++++++==++
I77I777III7I?III?II77I777$777+::::IZO$=:~:7:::~~??II?+~~~~==+=~+I?+?==+I+=~=++I?++II????++==++?++?$OZZ$7I????++++++===+=
I7I7$II7$$$$7ZZ7II7$ZZZZZOZ$I~::::~$OZ~~::?:::~~+III+=:~~=~~==~II?~~=++I+++?I7I??++==+??===+++++I7$OZZ$$IIII???++=++====
ZZZZ$$$$OZZZZZZZZ$ZZOOOZOZOZ+~::===7O7~~~~+~::~==II?+=:~~=~~==~?~~==~==??=++++77II?+==+====++?I?I$Z8ZZ777IIIII?++===+===
$$OO888ZOZOZOOZOO$O88OOOOOZ7=~::~~=+Z+~~~=7~~~~~+?I+~:::~+=+===~~=+=~~~=??++=+++++++???IIII7IIIII$O8OZ7777III?+++==+==++
Z77Z$7$$$$$Z$ZZZOZOZ8OOZOO8+:::::==~7~,:::7~:::=I?I+~:::~~+=~:+:~+=~::=+==+==++===++=++?+???I?III$88OZIII?I+??+++++++==?
77II??I77777$ZOOOO8888OZO8I~:::~=~:~=:::::=:::~~?II=:~:~+?ZZ7~I:=~:::~~==??==++==++==++??????I777$O8O$II????+++++=+?+=++
ZOZZZZOZO$O888888888D888D$~::::::~~=~::,,=:,::=??II=:~:=++Z$?~?~~::~~~++==+=~====++?+=?I?+++?I777ZDDOZ7I7?I?I??++=??+=++
OOO8O8O88ZOD88888888D8D88+:::,::~=++::,,=::::+++?I+~:~~===~~~==~~=+?+??++====++=+++???II?++??III$$8N8Z$7III??????++++++?
888O8888O$8D88OOODO88O8O?~:::,:~~+++:::~?:::~??II?=~~~~:~~~~~??==+?+===~~==++++?+?????II?I??III7$ZONDOZ$7III?II?++?+++?+
ZZZZZOZZZ$7I7$$Z$OZ88O8$=~~~::::::::~~~=I~=~~++I?=~::::===~~~I~~=+=~~~++=+?+=+++=+?+++???+??III$$ZZD8O$7IIIIII?+?+??????
7III$$O$ZZZZOOO8888DD88?:~~=+==~~==~~~==?~===?II~:::::::~:===7++++=~+??=+???+==++?++++?I?????I77$$$8DZ$I???II?++????????
$$$ZZOO8OOOO88OO8ZOD887=:::::~=++?+?=~==~=~~+?I?::::::::::~=~7I?++=+??==~==+==+??+??++???I?III77$$$ONDZ$II?II?+?II+++?I?
ZZZZOOZO8OZOO88O8ZZ8O$=:::::::~~=???~::~~:::~?I?:::::::::==~+I+===++=+=~~~=++=++?+?++?I???I?II77$7$$DNO$77I7I?I?I?I????I
Z$ZO8OOOZZZ$$$OO8O8DO?~:~~:~~=++++=?~=~~::::+I?=~~~::::~~=~~I=~=~~~~=+++=+?=======+++I??????I777777$8N8$$77I??I???I?????
Z7$$$$Z$ZZ7$ZZ8OOO888?===~~~~~==+++I=~~~:::+?I?=~:=::~~=~==+7~:~~::~==~==?+~+++++++=+II??II7I777$77$ONDZ777I???+??++????
ZO8$$ZO8OO8Z$Z88O8DDI=:::~~~~~?7777$=:::::~?I?=:::~~~~++=+==+:~~~:~++=~=??+==+???++++IIII7II7777777$ZDNZ77???I??++++==++
OO7I?I77$888ZOD8O8D$?===+???+?$7$$ZZ=:::::=?I?=::::~~~~~~===+:~:~+??I++?+=++++?????II77IIIII77II7777ODNO$?I?III?I??+?+==
O7+~::~~~=+I$8DD8ND?=~~~:~==?III7ZZZ~~:::~+??+~::~~~~==+++=+=~==++??????++++==++???III77777777II77I$ODN87???I????????++?
8ZI?+????+??ZOOO8DZ=::::::~=++??7ZZZ~::::=??+~:::~~~~~+7I=~I?+=~==++++?+++=+=??+?+?+?77II7IIIIIIIIIZ8NN$I?IIIII?????????
OO8Z$7777$I7ZDD88D?=~~~~~=====+?7$ZI~:~:=+??~:~:::~~~~ZOZ?=?I===~~===+++=~=+=++??++???II?I??????IIIONNZ7III777777II?7?II
O888DD8DD8$$D8ZZZ$?==+++++=?I?I7777+:::~+??=~~~~~~=~~==?+==I=~~:~~~==++====~=+++?I???+?+????????II$88Z$77IIII???I????++?
O8DO8O8D8O$ZDN$$7+::::::~~~~=+?7$ZZ+~::=??=~~~~~~=+~=~~:~=+I~::::~===++==+======+++?????++??????I$8DDZI???+??+??++++++++
Z$7ZZ:7$$$$ZDNZI?=~~=~=====??I7Z$OO+::~=?=~~~==~:~+=~~~==~?+~~:~=+++?????++==~~~=++?III7II?????77Z8N8OZ77III???+++++??+?
ZZZ$77I+I7$ONNNZI=~~::::~==~=?II7$?~:~=?+~~~~=~::~++~~~~~~I=:~~===+????+++===~====++?????????III77$8OZ$7$7777777II???+++
ZZZZZZO$7$O8DNDNO+:::::::~~==++??=~~~=++~:~~=~~:~~?~~~~===I=::~=+====+?+++===~~~~====+++++=++?I7777$O$77III???I????IIII?
$7?+7ZO$$$8NNNDNZ=::~~+==++?+II7~~~~~=+~:~~~==~~:~7+==+?++I~~~==========+===~==~==~~==+++=+???II7777ZO7II?I????+??+?????
$?=+I?ZZ$O8DN8D87+=======~+??I$+~~~:=~~~~=~===~::~7+=~~~=++~~=~=~~=+=+=====~~~~===~~====+++?I77$$$$$$8NO$I??+?+??III????
O7II$OOZ$Z8DNNDD?==~~~:~~=+??I=~~:~~=~~==~~===::~~?~~~+?=I?==+++==+====+=====~~====~=~=+??II777$77777ONNZ7IIII??+++???I?
88Z777O$7ODDDNN7=~:~~~~~~=+?I?=~~:~=+~~~==++==~~~~====++?7+=+?+I?+??+++==+==~=======++???I77$$7III7I7ODNO$I??+???????++=
ZOZZZ8Z$7ODDDNDI=~::::~~:===++~~::~=~:~~~=~==~:~=+~~=~==~7I~===??+?I???+?++=+=+=+++++??II77777I77III7ODDO$$II?I?++++?+??
Z$$IOZZ$$Z8O8DD7=+==~~~~=+?7===~~~~=~:~~~==?~~::=++~==+++7?+=++?=?I?II?I?????I+?++???II7777IIIIIIII7$ODOZ$IIIII??++++=??
7+I$IZZZO8O8O8DZ+====~++?777=~=~~~~=~~~~~+==~~~=~+=~~~=~+I=~=++?=+?I????II?I??????IIIIIIII7II?II?I?IZOOZ$7I?III????????+
7??$Z8OO88ZOOOOZ?=++==??II$+~+=~~~~::~~~====~:~=+~~=?=~~7~~~~~==~+I?I????II7I????+III777I7IIII?????I$$777I????+?++++II77
8Z77Z$ZZZZOOOZOZ+~++~=++=?+~~=+~===~~~~~~=~~:~~~~~+ZZ$=~I=~+=~~~=+??I?I?+?IIIIII7IIIIII7I?I?I?II??I$8O?I?I??+I???++????I
8OOOZOZZ$ZOZZOZ$+=++==?=+?=~==+==+=+~~====~=~:~+~~=I$7=+?==??++???IIII?I??III7IIIIIIIIIIIIII???????ZN8I?+???+I?III?+?+??
</pre>
<br />Filed under: <a href='http://summitprojectsflashblog.wordpress.com/category/flash/'>Flash</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/811/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=811&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/05/12/bye-bye-amos-bye-bye-happiness/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>On the verge of something big..</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/01/27/on-the-verge-of-something-big/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/01/27/on-the-verge-of-something-big/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:52:38 +0000</pubDate>
		<dc:creator>amoslanka</dc:creator>
				<category><![CDATA[TextMate]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=789</guid>
		<description><![CDATA[Happy Apple Tablet day, everyone.. (ht) Posted in TextMate Tagged: apple, tablet, textmate<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=789&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Happy Apple Tablet day, everyone..</p>
<p><a href="http://summitprojectsflashblog.files.wordpress.com/2010/01/image.jpg"><img src="http://summitprojectsflashblog.files.wordpress.com/2010/01/image.jpg?w=490" alt="" title="Image" /></a></p>
<p>(<a href="http://www.flickr.com/photos/12790868@N02/4308467369/">ht</a>)</p>
<br />Posted in TextMate Tagged: apple, tablet, textmate <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/789/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/789/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/789/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/789/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/789/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/789/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/789/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/789/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=789&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/01/27/on-the-verge-of-something-big/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c96a04fb24ba639170cef9f459058a2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">amoslanka</media:title>
		</media:content>

		<media:content url="http://summitprojectsflashblog.files.wordpress.com/2010/01/image.jpg" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>
	</item>
		<item>
		<title>JSFL: Batch Process PNGs to SWFs</title>
		<link>http://summitprojectsflashblog.wordpress.com/2010/01/05/jsfl-batch-process-pngs-to-swfs/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2010/01/05/jsfl-batch-process-pngs-to-swfs/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 19:50:14 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Actionscript 2]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[JSFL/Extensibility]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=784</guid>
		<description><![CDATA[Here&#8217;s one of those things that we just sort of needed to do. Neal (nealio) is working on a project where we need several PNGs as external assets to be loaded into Flash. And these PNGs would work better as SWFs, where we can apply JPEG compression but maintain the alpha channel. We&#8217;ve used, in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=784&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one of those things that we just sort of needed to do.  Neal (nealio) is working on a project where we need several PNGs as external assets to be loaded into Flash.  And these PNGs would work better as SWFs, where we can apply JPEG compression but maintain the alpha channel.</p>
<p>We&#8217;ve used, in the past, a Fireworks extension to batch process PNGs as SWFs, and it&#8217;s worked well, except that Fireworks, even CS4, can only export AVM1 SWFs.  We&#8217;re forward thinkers.  We don&#8217;t like that.  How to batch process PNGs to AVM2 SWFs, then?</p>
<p>By rolling our own.  I whipped up this JSFL script in about 20 minutes, and then spent a little time testing and adding a few niceties.  In the end, it&#8217;s pretty simple but uses Flash as the batch tool, so that we can export for Flash 10/ActionScript 3.  Here&#8217;s the code:</p>
<pre><code>fl.outputPanel.clear();

var quality = prompt("Desired JPEG Quality:")
var smoothing;
var fla;

if (quality) {

	smoothing = confirm("Smoothing on?");

	quality = parseInt(quality);
	var folder = fl.browseForFolderURL("Choose a folder of images to process");

	if (folder) {
		fl.trace("STARTING BATCH PROCESS")
		fl.trace("JPEG Quality: " + quality);
		fl.trace("Smoothing:    " + smoothing);
		fl.trace("Base folder:  " + folder + "\n");
		fl.trace("FILES PROCESSED\n");

		start(folder);
	}
}

/**
 * Kicks things off.  Creates a new Flash document for PNG-import/SWF-creation purposes.  Then processes
 * the folder, and finally closes the Flash document.
 * @param	folder	URI of the folder to process.
**/
function start(folder) {
	fla = fl.createDocument();
	processFolder(folder, 0);
	fla.close(false);
}

/**
 * Takes a folder and iterates over the files in it.  Iterates recursively through sub-folers.  Only processes
 * files ending in .png, .jpg, .jpeg, or .gif.
 * @param	folder	URI of the folder to process
 * @param	level	An index of how many levels "deep" we are through the recursion.  Used for formatting
 * 					the output as files get processed.
**/
function processFolder(folder, level) {
	var files = FLfile.listFolder(folder, "files");
	var folders = FLfile.listFolder(folder, "directories");

	// Loop over the files, only processing
	var iLen = files.length;
	for (var i = 0; i &lt; iLen; i++) {
		var file = files[i];
		if (file.match(/\.(png|jpg|jpeg|gif)$/)) {
			fl.trace(tab(level) + file)
			createSWF(file, folder);
		}
	}

	// Recurse through the folders in this folders.
	iLen = folders.length;
	for (i = 0; i &lt; iLen; i++) {
		fl.trace(tab(level) + folders[i] + &quot;/&quot;)
		processFolder(folder + &quot;/&quot; + folders[i], level + 1);
	}
}

/**
 * Utility function to produce a string with a certain number of tabs in it (used to created an indented tree list
 * of files processed).
 * @param	level	How many tabs to produce.
**/
function tab(level) {
	var t = &quot;&quot;
	for (var i = 0; i &lt; level; i++) {
		t += &quot;\t&quot;;
	}
	return t;
}

/**
 * Takes an image file in a folder and creates a SWF of the same base name (ending in .swf) in the same folder.
 * @param	file	The file name (not the full file URI) of the image to turn into a SWF
 * @param	folder	The File URI of the folder that the file is in.
**/
function createSWF(file, folder) {
	var importURI = folder + &quot;/&quot; + file;
	fla.importFile(importURI);

	var sel = fl.getDocumentDOM().selection[0];
	sel.x = 0;
	sel.y = 0;

	var lib = sel.libraryItem;
	lib.compressionType = &quot;photo&quot;;
	lib.quality = quality;
	lib.allowSmoothing = smoothing;

	var filenamePieces = file.split(&quot;.&quot;);
	filenamePieces.pop();
	fla.exportSWF(folder + &quot;/&quot; + filenamePieces.join(&quot;.&quot;) + &quot;.swf&quot;);

	fla.deleteSelection();
}</code></pre>
<p>You may wonder what&#8217;s so special about an image saved in an AVM2 SWF.  Well, it turns out that in Flash 10, you can&#8217;t reparent an AVM2 SWF.  Try this:</p>
<pre><code>var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
l.load(new URLRequest("AVM1.swf"));

function onComplete(e:Event):void {
	addChild(l.content);
}</code></pre>
<p>And you&#8217;ll get the following runtime error:</p>
<pre><code>ArgumentError: Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to a different part of the displayList when it has been loaded into AVM2 (AS3) content.
	at flash.display::DisplayObjectContainer/addChild()
	at AVM2_fla::MainTimeline/onComplete()
</code></pre>
<p>Weirdly, you only get this error if you are publishing for Flash 10.  Change your publish settings for Flash 9, and the preceding example will work.</p>
<p>Even if you&#8217;re not reparenting the content, it&#8217;s probably not a bad idea, for performance reasons, to go AVM2 with all of your SWFs, even for SWFs that merely contain a bitmap.  I haven&#8217;t done any tests, but I would assume that creating Loaders with AVM1Movie instances in them is inherently slower than Loaders with Bitmaps and MovieClip in them.</p>
<p>I&#8217;d love to flesh this out and make it more robust.  A single UI would be nice, instead of a series of prompts and stuff.  In fact, a whole UI for selecting your files, your output destination, and your output format would be bully (much like the Fireworks extension we used).  But this was one of those &#8220;If I can&#8217;t figure this out in 20 minutes I&#8217;m giving up&#8221; things.  I figured I&#8217;d share because it does work, even if it&#8217;s a bit primitive.  If you have improvements, be it through suggestion or through actual code, let us know in the comments.</p>
<br />Posted in Actionscript 2, Actionscript 3, Flash, JSFL/Extensibility  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/784/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=784&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2010/01/05/jsfl-batch-process-pngs-to-swfs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>Loader.close(): Does It Work or Not?</title>
		<link>http://summitprojectsflashblog.wordpress.com/2009/12/21/loader-close-does-it-work-or-not/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2009/12/21/loader-close-does-it-work-or-not/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 22:41:11 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=779</guid>
		<description><![CDATA[The short answer: Yes and no. Or slightly more accurately, No and yes. Confused? As was I. On to the long answer (don&#8217;t worry, not as long as is usual for me): The addition of the close method on the Loader class is pretty great. We can now finally stop a load in progress if, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=779&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The short answer: Yes and no.</p>
<p>Or slightly more accurately, No and yes.</p>
<p>Confused?  As was I.  On to the long answer (don&#8217;t worry, not as long as is usual for me):</p>
<p>The addition of the close method on the Loader class is pretty great.  We can now finally stop a load in progress if, for whatever reason, we deem it necessary.  Maybe the user changed her mind and clicked another button while one SWF (no longer needed) was loading.  Maybe we want to do something tricksy like start loading an asset, but not fully, to get the bytesTotal.</p>
<p>MovieClipLoader in AS2 had unloadClip, and you could interrupt a load in progress by telling it to load a non-existant URL into the same clip&#8230;but this is agreeably messy.  So hurrah for Loader.close!</p>
<p>Except&#8230;if you try it out, it most likely won&#8217;t work.  Create a simple test FLA with a clip set to be a button, called &#8220;btn_mc&#8221; and add the following code to the first frame:</p>
<pre><code>var l:Loader = new Loader();
addChildAt(l, 0);
l.load(new URLRequest("<strong>path/to/some/large/asset.swf</strong>"));

btn_mc.addEventListener(MouseEvent.CLICK, doit);

function doit(me:MouseEvent):void {
	trace('doing it');
	l.close();
}</code></pre>
<p>Now test the SWF, and then enter bandwidth simulation mode (press Command/Control-Enter again), and <strong>while the asset is still loading</strong>, click the button.  But wait for it&#8230;and you&#8217;ll see it show up anyway?  Wisconsin Tourism Federation? (work out the acronym&#8230;)</p>
<p>This is the &#8220;no&#8221; in the &#8220;no and yes&#8221; answer.  I put the &#8220;no&#8221; first because this is likely the first thing you&#8217;ll try when working with Loader.close.  So what about that &#8220;yes?&#8221;  Is there some extra step to take?  Some undocumented feature to enable?</p>
<p>No, it&#8217;s even simpler than that.  You need to load your asset from a server.</p>
<p>Replace the &#8220;path/to/some/large/asset.swf&#8221; with &#8220;http://some.domain/path/to/some/large/asset.swf&#8221; and you should be good.</p>
<p>Needless to say, this can be the source of confusion.  I don&#8217;t know what makes an HTTP stream different from a local file stream, but I concede that there are differences and that that probably accounts for this behavior.  But it sure would be great if this behavior were mentioned in the documentation.  It would be even better if this method just <em>worked</em>.  Why can&#8217;t we close a Loader when loading an asset locally?  This is how 99% of our development takes place; we almost always use a relative path to the asset, and we almost always develop on our local boxes without worrying about servers initially.</p>
<br />Posted in Flash  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/779/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=779&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2009/12/21/loader-close-does-it-work-or-not/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
		<item>
		<title>DisplayObjects Round Their X and Y Properties, Makes Brownian Motion Difficult</title>
		<link>http://summitprojectsflashblog.wordpress.com/2009/12/17/displayobjects-round-their-x-and-y-properties-makes-brownian-motion-difficult/</link>
		<comments>http://summitprojectsflashblog.wordpress.com/2009/12/17/displayobjects-round-their-x-and-y-properties-makes-brownian-motion-difficult/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 00:43:00 +0000</pubDate>
		<dc:creator>Dru Kepple</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://summitprojectsflashblog.wordpress.com/?p=773</guid>
		<description><![CDATA[Earl and I just hammered out a weird issue in some code that involved Brownian motion. Check this out, assuming p is a MovieClip on the stage: addEventListener(Event.ENTER_FRAME, animate); function animate(e:Event):void { p.x += Math.random() * 2 - 1; p.y += Math.random() * 2 - 1; } Seems simple enough, right? The particle p should [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=773&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Earl and I just hammered out a weird issue in some code that involved Brownian motion.  Check this out, assuming <code>p</code> is a MovieClip on the stage:</p>
<pre><code>addEventListener(Event.ENTER_FRAME, animate);

function animate(e:Event):void {
    p.x += Math.random() * 2 - 1;
    p.y += Math.random() * 2 - 1;
}
</code></pre>
<p>Seems simple enough, right?  The particle <code>p</code> should move randomly, and produce what is called &#8220;Brownian motion.&#8221;  It should wander, but ultimately stay within a general area, on average.</p>
<p>However, if you let it run long, you&#8217;ll find the particle tending to gravitate to 0, 0.  If you&#8217;re impatient, you can speed up the process like this:</p>
<pre><code>addEventListener(Event.ENTER_FRAME, animate);

function animate(e:Event):void {
    <strong>for (var i:int = 0; i &lt; 100; i++) {</strong>
        p.x += Math.random() * 2 - 1;
        p.y += Math.random() * 2 - 1;
    <strong>}</strong>
}
</code></pre>
<p>After trying quite a few things, we eventually tried the following:</p>
<pre><code>addEventListener(Event.ENTER_FRAME, animate);

<strong>var realX:Number = p.x;</strong>
<strong>var realY:Number = p.y;</strong>

function animate(e:Event):void {
    <strong>realX += Math.random() * 2 - 1;</strong>
    <strong>realY += Math.random() * 2 - 1;</strong>
    p.x = realX;
    p.y = realY;
}
</code></pre>
<p>Again, you can wrap that up in the loop to speed things up.</p>
<p>Either way, you&#8217;ll notice that we get proper motion now.  What gives?</p>
<p>Well, the suspicion that lead to us trying that was confirmed when we added a trace:</p>
<pre><code>addEventListener(Event.ENTER_FRAME, animate);

var realX:Number = p.x;
var realY:Number = p.y;

function animate(e:Event):void {
    realX += Math.random() * 2 - 1;
    realY += Math.random() * 2 - 1;
    p.x = realX;
    p.y = realY;

    <strong>trace(realX, p.x);</strong>
}
</code></pre>
<p>You&#8217;ll see something like this:</p>
<pre><code>310.60525778401643 310.6
311.387398567982 311.35
312.1899666218087 312.15
311.5306175108999 311.5
311.22865250799805 311.2
311.0907105393708 311.05
310.28716491162777 310.25
309.4788754032925 309.45
309.128194604069 309.1
308.98307433445007 308.95
309.23653392959386 309.2
308.6192215178162 308.6
309.3771039834246 309.35
</code></pre>
<p>Check <em>that</em> out!  The x property (and the y, too, we checked) is rounded internally to the nearest .05.  Actually, it&#8217;s not even rounded, it&#8217;s floored (my assumption is that it&#8217;s just truncating some bits resulting in a floor effect, which would presumably be a faster operation that <code>Math.floor</code>).</p>
<p>So, basically, we&#8217;re talking about rounding errors that, when piled up, result in a gradual approach to 0.  For example, say you start at 10.  You generate your random number, and it&#8217;s -1.46.  You take x property of 10, subtract 1.46, and you&#8217;d expect to end up at 8.54.  Instead, you end up 8.5.  Confirm it with the following code:</p>
<pre><code>p.x = 10;
p.x += -1.46
trace(p.x);
trace(10 - 1.46)
</code></pre>
<p>A similar effect happens with positive numbers&#8230;you end up smaller than you think you will.  Thus, a gradual approach to 0.</p>
<p>The fix involves tracking a high-precision Number value as the &#8220;real&#8221; x and y, and adding to that.  Then, simply assigning that value to the MovieClip&#8217;s x and y still results in rounding, but without any cumulative effects.  Anyone else remember the similar problem from ActionScript 2 days with <code>_alpha</code>?</p>
<p>My theory is that since there is a finite precision to Numbers, we&#8217;d still see a gradual approach to 0, only it&#8217;ll take MUCH longer.</p>
<p>So, I&#8217;m not necessarily pointing the finger at Adobe here and saying this is a bug; this is clearly intentional behavior, and 99% of the time you don&#8217;t even notice.  But when you do have that situation where it matters, you need to know about it.</p>
<br />Posted in Actionscript 3, Flash, Tips  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/summitprojectsflashblog.wordpress.com/773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/summitprojectsflashblog.wordpress.com/773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/summitprojectsflashblog.wordpress.com/773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/summitprojectsflashblog.wordpress.com/773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/summitprojectsflashblog.wordpress.com/773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/summitprojectsflashblog.wordpress.com/773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/summitprojectsflashblog.wordpress.com/773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/summitprojectsflashblog.wordpress.com/773/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=summitprojectsflashblog.wordpress.com&amp;blog=4023022&amp;post=773&amp;subd=summitprojectsflashblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://summitprojectsflashblog.wordpress.com/2009/12/17/displayobjects-round-their-x-and-y-properties-makes-brownian-motion-difficult/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19e431f5492f4af013d122d0742872a6?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">drukepple</media:title>
		</media:content>
	</item>
	</channel>
</rss>
