<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>fat lines of code</title>
	
	<link>http://fatlinesofcode.philipandrews.org</link>
	<description>Freelance flash &amp; html5 developer. Melbourne, Australia</description>
	<lastBuildDate>Thu, 28 Mar 2013 22:58:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/FatLinesOfCode" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="fatlinesofcode" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>HTML5 Musical Balls</title>
		<link>http://fatlinesofcode.philipandrews.org/2013/02/12/html5-musical-balls/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2013/02/12/html5-musical-balls/#comments</comments>
		<pubDate>Wed, 13 Feb 2013 04:28:12 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[collision]]></category>
		<category><![CDATA[easeljs]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[soundjs]]></category>
		<category><![CDATA[web audio]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=763</guid>
		<description><![CDATA[<p><a href="http://srv.re/balls" target="blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2013/02/balls.jpg" alt="musical-balls" /></a></p>
<p>Wow its been over a year since I last blogged. Anyways, here is something fun I put together today. Its a bouncing balls collision animation. When the balls collide they play a familiar tune. Make sure you try it on your iPad or iPhone as the sounds work via the web audio api (on iOS6+) and tilting the screen will change the direction the balls are traveling.</p>
<p>Demo <a href="http://srv.re/balls" target="blank">here</a>.</p>
<p>Source code <a href="https://github.com/fatlinesofcode/musical-balls"  target="blank">here</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://srv.re/balls" target="blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2013/02/balls.jpg" alt="musical-balls" /></a></p>
<p>Wow its been over a year since I last blogged. Anyways, here is something fun I put together today. Its a bouncing balls collision animation. When the balls collide they play a familiar tune. Make sure you try it on your iPad or iPhone as the sounds work via the web audio api (on iOS6+) and tilting the screen will change the direction the balls are traveling.</p>
<p>Demo <a href="http://srv.re/balls" target="blank">here</a>.</p>
<p>Source code <a href="https://github.com/fatlinesofcode/musical-balls"  target="blank">here</a>.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2013%2F02%2F12%2Fhtml5-musical-balls%2F&amp;via=philipandrews&amp;text=HTML5%20Musical%20Balls&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2013%2F02%2F12%2Fhtml5-musical-balls%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/15dIFn1rd8k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2013/02/12/html5-musical-balls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dark Intellij 11 color scheme for actionscript</title>
		<link>http://fatlinesofcode.philipandrews.org/2012/02/07/dark-intellij-11-color-scheme-for-actionscript/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2012/02/07/dark-intellij-11-color-scheme-for-actionscript/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 06:00:21 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[intellij]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=757</guid>
		<description><![CDATA[<p>I recently upgraded Intellij from version 10 to 11. Jetbrains have upgraded he syntax colouring for actionscript and javascript in this version so it is now separated ( in version 10 it was combined). This is great except they never wrote an import script for bringing your actionscript colours from version 10 over to 11, if you try it you are are going end up with a hot mess. I&#8217;ve manually recreated what I had previously by hand. If you&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded Intellij from version 10 to 11. Jetbrains have upgraded he syntax colouring for actionscript and javascript in this version so it is now separated ( in version 10 it was combined). This is great except they never wrote an import script for bringing your actionscript colours from version 10 over to 11, if you try it you are are going end up with a hot mess. I&#8217;ve manually recreated what I had previously by hand. If you like dark scheme&#8217;s then download this one, you know what they say: once you go black you never go back.</p>
<p><a href="http://fatlinesofcode.philipandrews.org/wp-content/uploads/as3dark.jar">as3dark.jar</a></p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2012%2F02%2F07%2Fdark-intellij-11-color-scheme-for-actionscript%2F&amp;via=philipandrews&amp;text=Dark%20Intellij%2011%20color%20scheme%20for%20actionscript&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2012%2F02%2F07%2Fdark-intellij-11-color-scheme-for-actionscript%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/3-yJjc_kbhI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2012/02/07/dark-intellij-11-color-scheme-for-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Collage Creator</title>
		<link>http://fatlinesofcode.philipandrews.org/2011/12/20/html5-collage-creator/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2011/12/20/html5-collage-creator/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 00:02:11 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=726</guid>
		<description><![CDATA[<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/12/blogshot3.jpg" alt="Collage" />

This week I started playing around with colour analysis in html5. I used it to create an image collage of your Facebook profile from your Facebook friends photos. I was quite surprised at how well it preformed particularly on mobile. As its nearly Christmas I managed to role this experiment into an interactive Christmas app.]]></description>
			<content:encoded><![CDATA[<p><a href="http://philipandrews.org/fbxmas" target="blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/12/blogshot3.jpg" alt="Collage" /></a></p>
<p>This week I started playing around with colour analysis in html5. I used it to create an image collage of your Facebook profile from your Facebook friends photos. I was quite surprised at how well it preformed particularly on mobile. As its nearly Christmas I managed to role this experiment into an interactive Christmas app. You can check it out <a href="http://philipandrews.org/fbxmas" target="blank">here</a>.</p>
<p><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/12/blogshot2.jpg" alt="Collage" /></p>
<p>Creating this experiment was surprisingly easy. Here is an explanation of the technique.</p>
<p>First you need to load all your photos you want to use to create the collage into a Canvas element.  One annoying gotcha of Html5 is that you cannot write images from a different domain to the Canvas due to security limitations. To get around this I used a simple php proxy to load the images via the local domain. Once loaded you can then get the average colour of the photo. To get the average colour I re-wrote some Flash code I had for doing this and modified it slightly to work with Canvas pixels. The photos are then stored in an array along with their corresponding average colour. </p>
<p>Next I load your Facebook profile pic into the canvas. Instead of getting the average colour of this image, I loop through every pixel of the image and get the pixel colour. This colour is then matched with the closest average colour from my previous list. Again is some <a href="http://blog.soulwire.co.uk/code/actionscript-3/colourutils-bitmapdata-extract-colour-palette" target="blank">Flash code</a> which I re-wrote. Then I use <a href="http://easeljs.com/">easeljs</a> to create a larger canvas image. The image is redrawn where each pixel is represented by the a friend image with the closest matched average colour to the pixel colour.<br />
Finally the zooming effect at the end is achieved using a CSS3 transition. Interestedly this transition runs much faster when apply to a canvas element then when applied to a image element.</p>
<p>If you are interested in the code for this experiment you can view the javascript on the site as its un-compressed. The colour functions are also available below.</p>
<pre class="brush: jscript; title: ;">

function getCanvasAverageColour(canvas, width, height) {
    var context, data, r,g,b, len, color = {r:0,g:0,b:0};
    r=g=b=0;
    context = canvas.getContext('2d')
    try {
        data = context.getImageData(0, 0, width, height);
    } catch(e) {
        alert('security error, img on diff domain? '+e);
        return color;
    }
    len = data.data.length;
    for (var i = 0; i &lt; len; i += 4) {
        r += data.data[i];
        g += data.data[i + 1];
        b += data.data[i + 2];
    }
    len/=4;
    color.r = ~~(r / len);
    color.g = ~~(g / len);
    color.b = ~~(b / len);
    return color;
}
function getCanvasPixelColors(canvas, width, height){
    var bmp = canvas.getContext('2d').getImageData(0, 0, width, height);
    var pixels = bmp.data;
    var colors = [];
    var i = 0;
    for (i = 0; i &lt; pixels.length; i += 4) {
        colors[i / 4] = {r:pixels[i],g:pixels[i + 1],b:pixels[i + 2],a:pixels[i + 3]};
    }
    return colors;
}
function similarColor( rgb1, rgb2, tolerance)
{
    tolerance==null? tolerance=0.01 : tolerance

	tolerance = tolerance * ( 255 * 255 * 3 ) &lt;&lt; 0;

	var distance = 0;

	distance += Math.pow( rgb1.r - rgb2.r, 2 );
	distance += Math.pow( rgb1.g - rgb2.g, 2 );
	distance += Math.pow( rgb1.b - rgb2.b, 2 );

	return distance &lt;= tolerance;
}
</pre>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F12%2F20%2Fhtml5-collage-creator%2F&amp;via=philipandrews&amp;text=HTML5%20Collage%20Creator&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F12%2F20%2Fhtml5-collage-creator%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/shbMpqsUagw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2011/12/20/html5-collage-creator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New HTML5 Portfolio</title>
		<link>http://fatlinesofcode.philipandrews.org/2011/08/12/new-html5-portfolio/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2011/08/12/new-html5-portfolio/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 07:00:27 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=701</guid>
		<description><![CDATA[<p><a href="http://philipandrews.org" target="blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/08/blogshot.jpg" alt="portfolio screenshot" /></a><br />
This week I put my new <a href="http://philipandrews.org" target="blank">portfolio</a> site live showcasing some of the client work I&#8217;ve done over the past two years. I decided to it would also be a good opportunity to skill up on the latest advances in html5. The concept behind the site was to create a typically Flash style experience but using javascript/css3 and html5 instead. The most interesting feature of the site is the fullscreen animated background. This was created using the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://philipandrews.org" target="blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/08/blogshot.jpg" alt="portfolio screenshot" /></a><br />
This week I put my new <a href="http://philipandrews.org" target="blank">portfolio</a> site live showcasing some of the client work I&#8217;ve done over the past two years. I decided to it would also be a good opportunity to skill up on the latest advances in html5. The concept behind the site was to create a typically Flash style experience but using javascript/css3 and html5 instead. The most interesting feature of the site is the fullscreen animated background. This was created using the <a href="http://easeljs.com/" target="_blank">EaselJS</a> library to draw colors and shapes to a canvas element. You&#8217;ll need a modern browser like Chrome, Firefox or ie9 to view this feature. The site is also compatible with mobile and iOS devices. Unfortunately these devices do not have enough power to run the background animations at a decent framerate so make sure you checkout it out on a desktop too.  There is also a fun easter egg embedded in the site, have fun trying to activate it.</p>
<p>This site was awarded <a href="http://www.awwwards.com/web-design-awards/philip-andrews" target="_blank">site of day</a> at Awwwards on 19th Aug 2011.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F08%2F12%2Fnew-html5-portfolio%2F&amp;via=philipandrews&amp;text=New%20HTML5%20Portfolio&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F08%2F12%2Fnew-html5-portfolio%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/BTyOyg43pgc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2011/08/12/new-html5-portfolio/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Australian Income Tax Calculator</title>
		<link>http://fatlinesofcode.philipandrews.org/2011/08/07/australian-income-tax-calculator/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2011/08/07/australian-income-tax-calculator/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 01:50:09 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=669</guid>
		<description><![CDATA[<img src="http://philipandrews.org/assets/img/paycalc.jpg" >	

PayCalc is a new app I created for iPhone. It allows you to enter your total income and you can quickly view your net income across any pay period, Yearly, Monthly, Weekly etc. You can also calculate your income in reverse for example, you can enter your net income per week and then view your gross income per year. Its quick and simple to use, its free for a limited time so head over to the <a href="http://itunes.apple.com/au/app/paycalc/id450347933?mt=8#" target="_blank">Apple store</a> to download it.]]></description>
			<content:encoded><![CDATA[<p><!--thumbnails slideshow begin--></p>
<div id="SlideItMoo_banners_outer" class="SlideItMoo_banners_outer">
<div id="SlideItMoo_banners_inner" class="SlideItMoo_banners_inner">
<div id="SlideItMoo_banners_items" class="SlideItMoo_banners_items"><a class="banner" href="#" target="_blank"><img src="http://philipandrews.org/assets/img/paycalc.jpg" ></a>	<a class="banner" href="#" target="_blank"><img src="http://philipandrews.org/assets/img/paycalc1.jpg"  /></a>	<a class="banner" href="#" target="_blank"><img src="http://philipandrews.org/assets/img/paycalc2.jpg" /></a><a class="banner" href="#" target="_blank"><img src="http://philipandrews.org/assets/img/paycalc4.jpg" /></a>
			</div>
</p></div>
</p></div>
<p><!-- banner rotator end -->	</p>
<p>PayCalc is a new app I created for iPhone. It allows you to enter your total income and you can quickly view your net income across any pay period, Yearly, Monthly, Weekly etc. You can also calculate your income in reverse for example, you can enter your net income per week and then view your gross income per year. Its quick and simple to use, its free for a limited time so head over to the <a href="http://itunes.apple.com/au/app/paycalc/id450347933?mt=8#" target="_blank">Apple store</a> to download it.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F08%2F07%2Faustralian-income-tax-calculator%2F&amp;via=philipandrews&amp;text=Australian%20Income%20Tax%20Calculator&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F08%2F07%2Faustralian-income-tax-calculator%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/aZba55lbv5s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2011/08/07/australian-income-tax-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ant task to terminate Flash Player Debugger</title>
		<link>http://fatlinesofcode.philipandrews.org/2011/05/29/ant-task-to-terminate-flash-player-debugger/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2011/05/29/ant-task-to-terminate-flash-player-debugger/#comments</comments>
		<pubDate>Mon, 30 May 2011 03:40:47 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[intellij]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=644</guid>
		<description><![CDATA[<p>I&#8217;ve just switched over to IntelliJ as my actionscript editor. The IDE is great, really fast with some great features. Check out the review over at <a href="http://www.flashmagazine.com/reviews/detail/review_intellij_idea/">Flash magazine</a>.<br />
They only recently introduced actionscript support so its still kind of light on customisation for developing with the Flash platform. One thing that was driving me nuts is that when you debug a swf it always opens in a new window. There is no close previous player or terminate process. However&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just switched over to IntelliJ as my actionscript editor. The IDE is great, really fast with some great features. Check out the review over at <a href="http://www.flashmagazine.com/reviews/detail/review_intellij_idea/">Flash magazine</a>.<br />
They only recently introduced actionscript support so its still kind of light on customisation for developing with the Flash platform. One thing that was driving me nuts is that when you debug a swf it always opens in a new window. There is no close previous player or terminate process. However this easy enough to achieve with an Ant script. Add the following to your build script and then in the project debug configuration, choose run Ant script before launch.</p>
<pre class="brush: xml; title: ;">
&lt;target name=&quot;closeDebugger&quot;&gt;
		&lt;exec executable=&quot;killall&quot;&gt;
		    &lt;arg line=&quot;-9 'Flash Player Debugger'&quot; /&gt;
		&lt;/exec&gt;
	&lt;/target&gt;
</pre>
<p>This will kill all the Flash Player&#8217;s that are open. Its pretty dirty but it works well. This is a unix command, so will only work on Mac or on a Pc with Cygwin installed.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F05%2F29%2Fant-task-to-terminate-flash-player-debugger%2F&amp;via=philipandrews&amp;text=Ant%20task%20to%20terminate%20Flash%20Player%20Debugger&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F05%2F29%2Fant-task-to-terminate-flash-player-debugger%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/sFCKvWxsGpk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2011/05/29/ant-task-to-terminate-flash-player-debugger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Away3D BezierPatch</title>
		<link>http://fatlinesofcode.philipandrews.org/2011/03/16/away3d-bezierpatch/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2011/03/16/away3d-bezierpatch/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 00:16:02 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[bezier surface]]></category>
		<category><![CDATA[bezierpatch]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[drawTriangles]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[warping]]></category>
		<category><![CDATA[wonder.fl]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=620</guid>
		<description><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/bezierpatch.jpg" alt="image warp" />
</div>
<p>I&#8217;ve been playing around the <a href="http://www.geepers.co.uk/software/bezier_patch_tutorial.html" target="_blank">BezierPatch </a>primitive in <a href="http://away3d.com/" target="_blank">away3D </a>recently. It works in a similar way to the <a href="http://fatlinesofcode.philipandrews.org/2011/02/20/warping-bitmaps-with-a-bezier-surface/" >bezier surface</a> i created. Its quite easy to create some very interesting effects. The source for this is on <a href="http://wonderfl.net/" target="_blank">wonder.fl</a> so <a href="http://wonderfl.net/c/yLPf" >fork it</a> and make it your own.</p>
<p></p>
<p class="ttlBpWonderfl" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a title="BezierPatch away3D" href="http://wonderfl.net/c/yLPf">BezierPatch away3D &#8211; wonderfl build flash online</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/bezierpatch.jpg" alt="image warp" />
</div>
<p>I&#8217;ve been playing around the <a href="http://www.geepers.co.uk/software/bezier_patch_tutorial.html" target="_blank">BezierPatch </a>primitive in <a href="http://away3d.com/" target="_blank">away3D </a>recently. It works in a similar way to the <a href="http://fatlinesofcode.philipandrews.org/2011/02/20/warping-bitmaps-with-a-bezier-surface/" >bezier surface</a> i created. Its quite easy to create some very interesting effects. The source for this is on <a href="http://wonderfl.net/" target="_blank">wonder.fl</a> so <a href="http://wonderfl.net/c/yLPf" >fork it</a> and make it your own.</p>
<p><script src="http://wonderfl.net/blogparts/yLPf/js" type="text/javascript"></script></p>
<p class="ttlBpWonderfl" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a title="BezierPatch away3D" href="http://wonderfl.net/c/yLPf">BezierPatch away3D &#8211; wonderfl build flash online</a></p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F03%2F16%2Faway3d-bezierpatch%2F&amp;via=philipandrews&amp;text=Away3D%20BezierPatch&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F03%2F16%2Faway3d-bezierpatch%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/fJaaB_YNgFk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2011/03/16/away3d-bezierpatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Warping Bitmaps with a Bezier Surface</title>
		<link>http://fatlinesofcode.philipandrews.org/2011/02/20/warping-bitmaps-with-a-bezier-surface/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2011/02/20/warping-bitmaps-with-a-bezier-surface/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 02:57:07 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bezier surface]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[drawTriangles]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[warping]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=540</guid>
		<description><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/blog-triangles2.jpg" alt="image warp" />
</div>
If you have read my previous posts on <a href="http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/">drawTriangles</a>, you will see that I love warping images. I decided to take this a bit further by using a <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_surface" target="_blank">Bezier surface</a>. A bezier surface or bezier patch can warp a grid by using a set of control points...]]></description>
			<content:encoded><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/blog-triangles2.jpg" alt="image warp" />
</div>
<p>If you have read my previous posts on <a href="http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/">drawTriangles</a>, you will see that I love warping images. I decided to take this a bit further by using a <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_surface" target="_blank">Bezier surface</a>. A bezier surface or bezier patch can warp a grid by using a set of control points. The control points in this example are the red circles, the grid can be seen by clicking the show grid checkbox. Try dragging the controls points to create your own warp or just sit back and watch the show.<br />
There is also a method for doing this using <a href="http://www.geepers.co.uk/software/bezier_patch_tutorial.html" target="_blank">away3d</a> plus checkout this <a href="http://labs.miaumiau.cat/?p=338" target="_blank">3d surface</a> built using nurbs.</p>
<p>
<object width="470" height="470">
<param name="movie" value="http://philipandrews.org/sandbox/BezierSurface/bin/BezierSurface.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="470" height="470" src="http://philipandrews.org/sandbox/BezierSurface/bin/BezierSurface.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><strong>Update:</strong><br />
You can view the bezier surface in action on this <a href="http://apps.facebook.com/fourd-choc-em/demo.php" target="_blank">client project</a> I worked on recently. The surface was used to create chewing mouth animations from user&#8217;s facebook photos.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F02%2F20%2Fwarping-bitmaps-with-a-bezier-surface%2F&amp;via=philipandrews&amp;text=Warping%20Bitmaps%20with%20a%20Bezier%20Surface&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2011%2F02%2F20%2Fwarping-bitmaps-with-a-bezier-surface%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/HITIB6HSrSk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2011/02/20/warping-bitmaps-with-a-bezier-surface/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Drawing a dashed line using the AS3 drawing API</title>
		<link>http://fatlinesofcode.philipandrews.org/2010/07/22/drawing-a-dashed-line-using-the-as3-drawing-api/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2010/07/22/drawing-a-dashed-line-using-the-as3-drawing-api/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 09:23:29 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[drawing api]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=433</guid>
		<description><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/blog-dashed-line.jpg" alt="image warp" />
</div>
<p>I was surprised recently to learn that the actionscript drawing api did not include a dashed-line style in the options. Well not to worry, drawing a dashed line is fairly straightforward. You just need to calculate the distance between each drawing points and divide it by the gap space. Then use a loop to draw multiple lines between the points, toggling the alpha to 0 or 1 on each iteration. Its not&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/blog-dashed-line.jpg" alt="image warp" />
</div>
<p>I was surprised recently to learn that the actionscript drawing api did not include a dashed-line style in the options. Well not to worry, drawing a dashed line is fairly straightforward. You just need to calculate the distance between each drawing points and divide it by the gap space. Then use a loop to draw multiple lines between the points, toggling the alpha to 0 or 1 on each iteration. Its not pixel perfect or anything, but its a relatively painless solution.</p>
<p>Checkout the example below to see it in action.</p>
<p><b>Dashed Line</b><br />

<object width="470" height="300">
<param name="movie" value="http://philipandrews.org/sandbox/DashedLine/bin/DashedLine.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="470" height="300" src="http://philipandrews.org/sandbox/DashedLine/bin/DashedLine.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><em>source</em></p>
<pre class="brush: as3; title: ;">
package {
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;

	/**
	 * @author Phil
	 */
	public class DashedLine extends Sprite {
		private var _lineThickness : Number = 1;
		private var _lineColor : uint = 0xFFFFFF;
		private var _dashSpace : Number = 5;

		public function DashedLine() {
			stage.align = StageAlign.TOP_LEFT
			stage.scaleMode = StageScaleMode.NO_SCALE
			graphics.beginFill(0x000000, 1)
			graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight)
			graphics.endFill();
			var data : Array = getPoints()
			var px : Number;
			var py : Number;
			var draw : Boolean = true;
			// main drawing loop
			for(var i : int = 0;i &lt; data.length;i++) {
				var x : Number = data[i][0]
				var y : Number = data[i][1]
				if(i == 0) {
					graphics.moveTo(x, y)
				} else {
					var dx : Number = x - px;
					var dy : Number = y - py;
					var distance : Number = Math.sqrt(dx * dx + dy * dy);
					// calculate the number of dashed to draw based on the distance between each point
					// always draw at least 1 line
					var loops : int = Math.max(1, Math.floor(distance / _dashSpace))
					// dash drawing loop
					for (var j : int = 0;j &lt; loops;j++) {
						var alpha : Number = draw ? 1 : 0; // toggle the alpha on and off for each dash iteration
						draw = !draw;
						graphics.lineStyle(_lineThickness, _lineColor, alpha)
						var a : Number = j / loops;
						graphics.lineTo(px + (dx * a), py + (dy * a))
					}
				}
				// complete the last line
				if(i == data.length - 1) {
					graphics.lineStyle(_lineThickness, _lineColor, 1)
					graphics.lineTo(x, y)
				}
				// save the previous position
				px = x
				py = y
			}
		}

		public function getPoints() : Array {
			var points : Array = [];
			points.push([100,300]);
			points.push([78.8,168.43990319999997]);
			points.push([88.64999999999999,167.8654816]);
			points.push([98.5,161.76375440000004]);
			points.push([108.35,159.4435878]);
			points.push([118.2,157.12367460000002]);
			points.push([128.05,161.7856192]);
			points.push([137.9,157.13815460000004]);
			points.push([147.75,150.45462099999997]);
			points.push([157.6,150.170813]);
			points.push([167.45,154.25098739999999]);
			points.push([177.29999999999998,151.93103799999997]);
			points.push([187.14999999999998,153.9744918]);
			points.push([197,153.4000702]);
			points.push([206.85,110.37080679999997]);
			points.push([216.7,130.17818400000002]);
			points.push([226.55,134.694658]);
			points.push([236.4,142.08358819999995]);
			points.push([246.25,138.89092920000002]);
			points.push([256.1,135.9892458]);
			points.push([265.95,133.0872366]);
			points.push([275.8,128.14915839999998]);
			points.push([285.65,123.79263320000001]);
			points.push([295.5,119.7267578]);
			points.push([305.35,117.2756667324]);
			points.push([315.2,50.82457562860003]);
			points.push([325.05,70.35882340200001]);
			points.push([334.9,90.44433818999997]);
			points.push([344.75,106.4859321994]);
			points.push([354.59999999999997,107.48357411719999]);
			points.push([364.45000000000005,106.0178218906]);
			points.push([374.29999999999995,104.05938458700001]);
			points.push([384.15000000000003,99.6382731932]);
			points.push([394,96.6944970124]);
			points.push([403.85,95.22874478580002]);
			points.push([413.7,92.77765371819999]);
			points.push([423.55,90.81921641459996]);
			points.push([433.4,87.87544023380002]);
			points.push([443.25,84.93169536599999]);
			points.push([453.1,84.94396709360001]);
			points.push([462.95,81.50750583580003]);
			points.push([472.8,77.08570573699996]);
			points.push([482.65,73.64924447920004]);
			points.push([492.5,69.22744434420002]);
			points.push([502.34999999999997,66.28369947639999]);

			points.push([502.34,300]);
			points.push([100,300]);
			return points;
		}
	}
}
</pre>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F07%2F22%2Fdrawing-a-dashed-line-using-the-as3-drawing-api%2F&amp;via=philipandrews&amp;text=Drawing%20a%20dashed%20line%20using%20the%20AS3%20drawing%20API&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F07%2F22%2Fdrawing-a-dashed-line-using-the-as3-drawing-api%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/wr8nNoZtW_U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2010/07/22/drawing-a-dashed-line-using-the-as3-drawing-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash 10 drawTriangles</title>
		<link>http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 03:43:41 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[drawTriangles]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[flash10]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=393</guid>
		<description><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/blog-triangles1.jpg" alt="image warp" />
</div>
<p>Adobe introduced some new functions in the flash 10 drawing api for 3d support. One of them is <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Graphics.html#drawTriangles%28%29" target="_blank">drawTriangles</a>. This enables bitmaps to be drawn to a 3d mesh. But it can also be used in 2d for skewing and warp effects. In a nutshell it allows you to define a shape and then map points of a bitmap to this shape. Click on the <a href="http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/#example">examples</a> below to see&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2011/03/blog-triangles1.jpg" alt="image warp" />
</div>
<p>Adobe introduced some new functions in the flash 10 drawing api for 3d support. One of them is <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Graphics.html#drawTriangles%28%29" target="_blank">drawTriangles</a>. This enables bitmaps to be drawn to a 3d mesh. But it can also be used in 2d for skewing and warp effects. In a nutshell it allows you to define a shape and then map points of a bitmap to this shape. Click on the <a href="http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/#example">examples</a> below to see the points of the rectangle warp to new positions. Here I&#8217;m defining the five points which make up the triangles and tweening the outside corners. The number of triangles and possibilities are infinite. This is great alternative to the infamous flash ide shape tween.<br />
You can find some even better examples on <a href="http://wonderfl.net" target="_blank">wonder.fl</a>. Just try searching for <a href="http://wonderfl.net/search?page=10&#038;q=drawTriangles&#038;search_order=new" target="_blank">drawTriangles</a>. Two of my favs are <a href="http://wonderfl.net/c/kzVu" target="_blank">wonderwall</a> and <a href="http://wonderfl.net/c/dvOl" target="_blank">genie effect</a>.</p>
<p><b>Random Warp</b> <a name="example"><br />

<object width="470" height="300">
<param name="movie" value="http://philipandrews.org/sandbox/drawTriangles/drawTriangles.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="470" height="300" src="http://philipandrews.org/sandbox/drawTriangles/drawTriangles.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><b>Bezier Minimise</b><br />

<object width="470" height="300">
<param name="movie" value="http://philipandrews.org/sandbox/drawTriangles/bezierTriangles.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="470" height="300" src="http://philipandrews.org/sandbox/drawTriangles/bezierTriangles.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><em>source for random warp</em></p>
<pre class="brush: as3; title: ;">
var _vertices:Vector.&lt;Number &gt;  = new Vector.&lt;Number &gt;   ;
var _indices:Vector.&lt;int &gt;  = new Vector.&lt;int &gt;   ;
var _uvtData:Vector.&lt;Number &gt;  = new Vector.&lt;Number &gt;   ;
var _image:BitmapData = new Foxy();
var border:Number = 0;
var _width:Number = stage.stageWidth;
var _height:Number = stage.stageHeight;
//define the triangles
_vertices.push(0, 0);
_vertices.push(_width, 0);
_vertices.push(_width/2, _height/2);
_vertices.push(0, _height);
_vertices.push(_width, _height);
_indices.push(1, 0, 2);
_indices.push(0, 2, 3);
_indices.push(1, 2, 4);
_indices.push(2, 3, 4);

//define the bitmap mapping to triangle points
_uvtData.push(0, 0);
_uvtData.push(1, 0);
_uvtData.push(0.5, 0.5);
_uvtData.push(0, 1);
_uvtData.push(1, 1);

stage.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e=null):void
{

	var endVertices:Vector.&lt;Number &gt;  = new Vector.&lt;Number &gt;   ;
	endVertices.push(randNum, randNum);
	endVertices.push(_width-randNum, randNum);
	endVertices.push(stage.stageWidth/2, stage.stageHeight/2);
	endVertices.push(randNum, _height-randNum);
	endVertices.push(_width-randNum, _height-randNum);
	TweenMax.to(_vertices, 0.5, {endVector:endVertices, ease:Expo.easeOut, onUpdate:update});
}
function update():void
{
	graphics.clear();
	graphics.beginBitmapFill(_image);
	graphics.drawTriangles(_vertices, _indices, _uvtData);
	graphics.endFill();
}
</pre>
<p><br/></p>
<p><em>source for bezier minimise</em></p>
<pre class="brush: as3; title: ;">
var _timeLine: TimelineMax;
var _vertices:Vector.&lt;Number &gt;  = new Vector.&lt;Number &gt;;
var _indices:Vector.&lt;int &gt;  = new Vector.&lt;int &gt;;
var _uvtData:Vector.&lt;Number &gt;  = new Vector.&lt;Number &gt;;
var _image:BitmapData = new Foxy();
var _width:Number = stage.stageWidth;
var _height:Number = stage.stageHeight;
//define the triangles
_vertices.push(startLT.x, startLT.y);
_vertices.push(startRT.x, startRT.y);
_vertices.push(startC.x, startC.y);
_vertices.push(startLB.x, startLB.y);
_vertices.push(startRB.x, startRB.y);
_indices.push(1, 0, 2);
_indices.push(0, 2, 3);
_indices.push(1, 2, 4);
_indices.push(2, 3, 4);

//define the bitmap mapping to triangle points
_uvtData.push(0, 0);
_uvtData.push(1, 0);
_uvtData.push(0.5, 0.5);
_uvtData.push(0, 1);
_uvtData.push(1, 1);

update();
function update():void
{
	_vertices[0]=startLT.x;_vertices[1]=startLT.y;
	_vertices[2]=startRT.x;_vertices[3]=startRT.y;
	_vertices[4]=startC.x;_vertices[5]=startC.y;
	_vertices[6]=startLB.x;_vertices[7]=startLB.y;
	_vertices[8]=startRB.x;_vertices[9]=startRB.y;

	graphics.clear();
	graphics.lineStyle(1, 0xFFFFFF);
	graphics.beginBitmapFill(_image);
	graphics.drawTriangles(_vertices, _indices, _uvtData);
	graphics.endFill();

}

stage.addEventListener(MouseEvent.CLICK, onClick);

function onClick(e=null):void
{

	if(_timeLine == null){
		var time:Number = 0.7;
		var ease:Function = Expo.easeInOut
		_timeLine = new TimelineMax({onUpdate:update});
		_timeLine.appendMultiple([
		TweenMax.to(startLT, time, {delay:0, bezierThrough:[{x:curveLT.x, y:curveLT.y}, { x:endLT.x, y:endLT.y}], ease:ease}),
		TweenMax.to(startRT, time, {delay:0, bezierThrough:[{x:curveRT.x, y:curveRT.y}, { x:endRT.x, y:endRT.y}], ease:ease}),
		TweenMax.to(startC, time, {delay:0, x:endC.x, y:endC.y, ease:ease}),
		TweenMax.to(startRB, time, {bezierThrough:[{x:curveRB.x, y:curveRB.y}, { x:endRB.x, y:endRB.y}], ease:ease}),
		TweenMax.to(startLB, time, {bezierThrough:[{x:curveLB.x, y:curveLB.y}, { x:endLB.x, y:endLB.y}], ease:ease})
		]);
	}else{
		if(_timeLine.reversed)
		_timeLine.play();
		else
		_timeLine.reverse();
	}

}
</pre>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F06%2F25%2Fflash-10-drawtriangles%2F&amp;via=philipandrews&amp;text=Flash%2010%20drawTriangles&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F06%2F25%2Fflash-10-drawtriangles%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/Qh6qgqyv00w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TextField fit to size</title>
		<link>http://fatlinesofcode.philipandrews.org/2010/05/31/textfield-fit-to-size/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2010/05/31/textfield-fit-to-size/#comments</comments>
		<pubDate>Mon, 31 May 2010 12:23:27 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textfield]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=380</guid>
		<description><![CDATA[This is one function that should be in every flash developer's toolbox. I'm so over adjusting textfields and font sizes to fit different lengths of content. There had to be better way I thought. How about a one size fits all solution. The function below uses a while loop to reduce the font size of the textfield one pt at a time until the text fits within the bounds of the width and height. Its almost too easy.]]></description>
			<content:encoded><![CDATA[<p>This is one function that should be in every flash developer&#8217;s toolbox. I&#8217;m so over adjusting textfields and font sizes to fit different lengths of content. There had to be better way I thought. How about a one size fits all solution. The function below uses a while loop to reduce the font size of the textfield one pt at a time until the text fits within the bounds of the width and height. Its almost too easy.</p>
<pre class="brush: as3; title: ;">
public static function fitToSize(txt : TextField, maxWidth:Number=-1, maxHeight:Number=-1) : void {
			var maxTextWidth : int = maxWidth &amp;amp;gt; 0 ? maxWidth : txt.width;
			var maxTextHeight : int = maxHeight &amp;amp;gt; 0 ? maxHeight : txt.height; 

			var f : TextFormat = txt.getTextFormat();

			while (txt.textWidth &amp;amp;gt; maxTextWidth || txt.textHeight &amp;amp;gt; maxTextHeight) {
				f.size = int(f.size) - 1;
				txt.setTextFormat(f);
			}
		}
</pre>
<p>Click on the stage below to view an example.<br />

<object width="470" height="300">
<param name="movie" value="http://philipandrews.org/sandbox/FitToSize/Main.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="470" height="300" src="http://philipandrews.org/sandbox/FitToSize/Main.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F05%2F31%2Ftextfield-fit-to-size%2F&amp;via=philipandrews&amp;text=TextField%20fit%20to%20size&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F05%2F31%2Ftextfield-fit-to-size%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/frOanY_1Ok0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2010/05/31/textfield-fit-to-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Catalyst project to SWC</title>
		<link>http://fatlinesofcode.philipandrews.org/2010/04/11/exporting-a-flash-catalyst-project-to-a-swc/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2010/04/11/exporting-a-flash-catalyst-project-to-a-swc/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 06:52:57 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[flashbuilder]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=363</guid>
		<description><![CDATA[<p>Flash Catalyst. Its great isn&#8217;t it? Import your layout file and quickly create flex components. Catalyst exports a layout to a flex project file (FXP). In flash builder you can import this file as a new project. However I&#8217;ve found it is pretty tricky to import these new components into to an existing project because it requires alot of a refactoring or an additional source path.<br />
I frequently use the export to swc feature within the Flash IDE to&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Flash Catalyst. Its great isn&#8217;t it? Import your layout file and quickly create flex components. Catalyst exports a layout to a flex project file (FXP). In flash builder you can import this file as a new project. However I&#8217;ve found it is pretty tricky to import these new components into to an existing project because it requires alot of a refactoring or an additional source path.<br />
I frequently use the export to swc feature within the Flash IDE to export my components into a flash builder project. It seemed strange that Adobe didn&#8217;t also include an export to swc feature in the latest flash builder. In order to export to a swc you need to use <a href="http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf69084-7fd2.html" target="_blank">compc</a> which is only accessible via the command line. Luckily you can use an ANT script to easily automate this task. If you don&#8217;t have ant installed for flash builder, follow the steps on <a href="http://www.zoltanb.co.uk/index.php?/Flash-Articles/fb4-standalone-how-to-install-ant-in-flash-builder-4-premium.php" target="_blank">this guide</a>. Once installed you can use the script to below to build a SWC out of your flex skin project. You can then you this use this swc in other projects to apply the skin to existing components by using the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/supportClasses/SkinnableComponent.html?filter_flex=4&#038;filter_flashplayer=10&#038;filter_air=1.5#style:skinClass" target="_blank">skinClass property</a>.</p>
<pre class="brush: xml; title: ;">
&lt;project name=&quot;MySkin&quot; default=&quot;compileSWC&quot; basedir=&quot;.&quot;&gt;
&lt;property name=&quot;PROJECT_NAME&quot; value=&quot;MySkin&quot; /&gt;
&lt;!-- change this line if your on a p.c. --&gt;
&lt;property name=&quot;FLEX_SDK&quot; location=&quot;/Applications/Adobe Flash Builder 4/sdks/4.0.0/&quot;/&gt;
&lt;property name=&quot;compc&quot; location=&quot;${FLEX_SDK}/bin/compc&quot;/&gt;
&lt;property name=&quot;mxmlc&quot; location=&quot;${FLEX_SDK}/bin/mxmlc&quot;/&gt;
&lt;property name=&quot;asdoc&quot; location=&quot;${FLEX_SDK}/bin/asdoc&quot;/&gt;
&lt;property name=&quot;SRC_DIR&quot; location=&quot;src&quot;/&gt;
&lt;property name=&quot;LIBS_DIR&quot; location=&quot;libs&quot;/&gt;
&lt;property name=&quot;RELEASE_DIR&quot; location=&quot;bin-release/&quot;/&gt;
&lt;property name=&quot;RELEASE_SWC&quot; location=&quot;${RELEASE_DIR}/${PROJECT_NAME}.swc&quot;/&gt;
&lt;property name=&quot;flashplayer&quot; value=&quot;/SAFlashPlayer&quot; /&gt;

&lt;property name=&quot;FLEX_SDK_NAME&quot; value=&quot;${FLEX_SDK}&quot; /&gt;
	&lt;target name=&quot;compileSWC&quot;&gt;
					 &lt;exec executable=&quot;${compc}&quot;&gt;
					 	&lt;arg line=&quot;-source-path '${SRC_DIR}' -library-path '${LIBS_DIR}' -target-player=10&quot;  /&gt;
					 	&lt;arg line=&quot;-output '${RELEASE_SWC}'&quot; /&gt;
					 	&lt;arg line=&quot;-is 'src'&quot; /&gt;
					 	&lt;arg line=&quot;-include-libraries 'libs'&quot; /&gt;
					 	&lt;arg line=&quot;-include-libraries '${FLEX_SDK}/frameworks/'&quot; /&gt;
					 	&lt;arg line=&quot;-include-libraries '${FLEX_SDK}/frameworks/libs/'&quot; /&gt;
					 	&lt;arg line=&quot;-include-libraries '${FLEX_SDK}/frameworks/locale/en_US/'&quot; /&gt;
					 &lt;/exec&gt;
			&lt;/target&gt;
&lt;/project&gt;
</pre>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F04%2F11%2Fexporting-a-flash-catalyst-project-to-a-swc%2F&amp;via=philipandrews&amp;text=Flash%20Catalyst%20project%20to%20SWC&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2010%2F04%2F11%2Fexporting-a-flash-catalyst-project-to-a-swc%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/LHyTPnwYnIw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2010/04/11/exporting-a-flash-catalyst-project-to-a-swc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Box2D Ballooning</title>
		<link>http://fatlinesofcode.philipandrews.org/2009/10/10/box2d-ballooning/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2009/10/10/box2d-ballooning/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 16:55:24 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=327</guid>
		<description><![CDATA[<div style="text-align:center; margin-bottom:10px">
<a style="border:none" href="http://philipandrews.org/sandbox/up/balloning.html" target="_blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2009/10/ballonscreen1.png" alt="ballonscreen" title="ballonscreen" width="450" height="269" class="aligncenter size-full wp-image-329" style="border:solid 1px white" /></a></div>
<p>Many of you may of seen Pixars recent movie <a href="http://disney.go.com/disneypictures/UP/" target="_blank">UP</a>. In the movie the main character manages to take flight in his house by attaching dozens of inflatable balloons to the roof. Seems a bit far fetched don&#8217;t you think? Obviously the guys at Pixar aren&#8217;t too concerned with the laws of physics.<br />
Well here at fatlinesofcode we don&#8217;t mind if cartoons break the laws of physcis either. But we&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center; margin-bottom:10px">
<a style="border:none" href="http://philipandrews.org/sandbox/up/balloning.html" target="_blank"><img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2009/10/ballonscreen1.png" alt="ballonscreen" title="ballonscreen" width="450" height="269" class="aligncenter size-full wp-image-329" style="border:solid 1px white" /></a></div>
<p>Many of you may of seen Pixars recent movie <a href="http://disney.go.com/disneypictures/UP/" target="_blank">UP</a>. In the movie the main character manages to take flight in his house by attaching dozens of inflatable balloons to the roof. Seems a bit far fetched don&#8217;t you think? Obviously the guys at Pixar aren&#8217;t too concerned with the laws of physics.<br />
Well here at fatlinesofcode we don&#8217;t mind if cartoons break the laws of physcis either. But we do love to test them.<br />
I have built a fun prototype game in Box2D to test this house ballooning theory. The house is a box with multiple balls attached via distance joints. Each of the balls has an anti-gravitational force applied to it which provides lift to the house. To pilot this balloon the UP arrow key is used to simulate adding more hot air to the balloons. Each time you press it an upward force is applied to each balloon thus providing more lift to the house. Additionally the LEFT and RIGHT arrow keys can be used to apply left and right forces to the house. Combining these controls you can achieve steady flight. Check out the <a href="http://philipandrews.org/sandbox/up/balloning.html" target="_blank">demo</a> and try manoeuvring your balloon through the various obstacles.<br />
<br/><br />
<a href="http://philipandrews.org/sandbox/up/src/org/philipandrews/up/Main.as" target="_blank">Source here</a></p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F10%2F10%2Fbox2d-ballooning%2F&amp;via=philipandrews&amp;text=Box2D%20Ballooning&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F10%2F10%2Fbox2d-ballooning%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/yPF8TG3q9-8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/10/10/box2d-ballooning/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pixelated video effect [Part II]</title>
		<link>http://fatlinesofcode.philipandrews.org/2009/07/13/pixelated-video-effect-part-ii/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2009/07/13/pixelated-video-effect-part-ii/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 03:57:30 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[copypixels]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=229</guid>
		<description><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2009/07/space.jpg" alt="space" title="space" width="330" height="290" class="aligncenter size-full wp-image-247" /></div>

I few weeks ago I posted a <a href="http://fatlinesofcode.philipandrews.org/2009/05/21/pixelated-video-effect/"> pixelation effect</a>. I have since optimised the code and also added in support for webcam input.

Checkout the demo and source code below.]]></description>
			<content:encoded><![CDATA[<div style="text-align:center">
<img src="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2009/07/space.jpg" alt="space" title="space" width="330" height="290" class="aligncenter size-full wp-image-247" /></div>
<p>I few weeks ago I posted a <a href="http://fatlinesofcode.philipandrews.org/2009/05/21/pixelated-video-effect/"> pixelation effect</a>. I have since optimised the code and also added in support for webcam input.</p>
<p>Checkout the demo and source code below.</p>
<p>
<object width="466" height="340">
<param name="movie" value="http://philipandrews.org/sandbox/explode/videowebcam/Explode.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="466" height="340" src="http://philipandrews.org/sandbox/explode/videowebcam/Explode.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p>Here is an explanation of the technique.</p>
<p>First get the bitmapData source from the video input. Then divide the data into a grid of new bitmaps using a double for-loop. Store each one these in a two dimensional array.</p>
<pre class="brush: as3; title: ;">
private function createBitmapGrid():void {

			var source:BitmapData = getVideoSource();

			var _w:Number=source.width;
			var _h:Number=source.height;
			var rows:Number=source.height/_divideGridBy; // cols
			var cols:Number=source.width/_divideGridBy; // rows
			var cellWidth:Number = _w/cols-_cellpadding;
			var cellHeight:Number = _h/rows-_cellpadding

			for (var i:uint=0; i&lt;cols; i++) {
				for (var j:uint=0; j&lt;rows; j++) {
					var tempBitmapData:BitmapData=new BitmapData(cellWidth,cellHeight, true, 0x000000);
					var tempBitmap:Bitmap =new Bitmap(tempBitmapData);
					tempBitmap.x=i*_w/cols;
					tempBitmap.y=j*_h/rows;
					if(! _particleArray[i])
					_particleArray[i] = {};
					_particleArray[i][j] = tempBitmap;
					_holder.addChild(tempBitmap);
				}
			} 			

		}
</pre>
<p>Then add an enterframe listener to update the all the bitmap cells in the grid. Add a double for-loop to go through each cell. Use the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html#copyPixels()">copyPixel</a> function to copy a rectangular portion of the source image to each cell. After you copy the source data, find the average brightness of the cell and use it as a variable to adjust the z value of the bitmap cell.</p>
<pre class="brush: as3; title: ;">
this.addEventListener(Event.ENTER_FRAME, updateBitmapGrid);
private function updateBitmapGrid(e:Event):void {

			var source:BitmapData = getVideoSource();

			var _w:Number=source.width;
			var _h:Number=source.height;
			var rows:Number=source.height/_divideGridBy; // cols
			var cols:Number=source.width/_divideGridBy; // rows
			var cellWidth:Number = _w/cols-_cellpadding;
			var cellHeight:Number = _h/rows-_cellpadding

			for (var i:uint=0; i&lt;cols; i++) {
				for (var j:uint=0; j&lt;rows; j++) {
					var tempBitmap:Bitmap = null;
					if (_particleArray[i]) {
						if(_particleArray[i][j]){
							tempBitmap=_particleArray[i][j];
						}
					}
					if(tempBitmap != null){
						var p:Point = new Point(0, 0);
						var rect:Rectangle = new Rectangle(tempBitmap.x+_cellpadding, tempBitmap.y+_cellpadding, cellWidth, cellHeight);
						tempBitmap.bitmapData.copyPixels(source, rect, p);
						var color:Number=getAverageColour(tempBitmap.bitmapData);
						var brightness:Number=getBrightness(getAverageColour(tempBitmap.bitmapData));
						if(_moveZ)
						tempBitmap.z = 255 - (brightness * 1);

					}
				}
			}
		}
</pre>
<pre class="brush: as3; title: ;">
private function getAverageColour( source:BitmapData ):Number {
			var red:Number=0;
			var green:Number=0;
			var blue:Number=0;

			var count:Number=0;
			var pixel:Number;

			for (var x:Number = 0; x &lt; source.width; x++) {
				for (var y:Number = 0; y &lt; source.height; y++) {
					pixel=source.getPixel(x,y);

					red+=pixel&gt;&gt;16&amp;0xFF;
					green+=pixel&gt;&gt;8&amp;0xFF;
					blue+=pixel&amp;0xFF;

					count++;
				}
			}

			red/=count;
			green/=count;
			blue/=count;

			return red &lt;&lt; 16 | green &lt;&lt; 8 | blue;
		}

		private function getBrightness(colour:Number):Number {
			var R:Number=0;
			var G:Number=0;
			var B:Number=0;

			R+=colour&gt;&gt;16&amp;0xFF;
			G+=colour&gt;&gt;8&amp;0xFF;
			B+=colour&amp;0xFF;

			var br:Number=Math.sqrt(R*R*.241+G*G*.691+B*B*.068);
			return br;
		}
</pre>
<p><a href="http://fatlinesofcode.philipandrews.org/wp-content/uploads/2009/07/videowebcam.zip">Download package<br />
</a></p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F07%2F13%2Fpixelated-video-effect-part-ii%2F&amp;via=philipandrews&amp;text=Pixelated%20video%20effect%20%5BPart%20II%5D&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F07%2F13%2Fpixelated-video-effect-part-ii%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/yWF-F6HXk_o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/07/13/pixelated-video-effect-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pixelated video effect</title>
		<link>http://fatlinesofcode.philipandrews.org/2009/05/21/pixelated-video-effect/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2009/05/21/pixelated-video-effect/#comments</comments>
		<pubDate>Fri, 22 May 2009 02:02:05 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=204</guid>
		<description><![CDATA[<p>I have been experimenting more and more with bitmapdata recently. Checkout this pixelation effect I have created for flash video.</p>
<p>Here is how it works. There is an onEnterFrame function which first creates a new Bitmap object from the video source data. A grid of smaller bitmaps is then created from this large bitmap. Each one of the smaller bitmaps is analysied for it&#8217;s average color and brightness. The z property (flash 10) is then set to the inverse of&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I have been experimenting more and more with bitmapdata recently. Checkout this pixelation effect I have created for flash video.</p>
<p>Here is how it works. There is an onEnterFrame function which first creates a new Bitmap object from the video source data. A grid of smaller bitmaps is then created from this large bitmap. Each one of the smaller bitmaps is analysied for it&#8217;s average color and brightness. The z property (flash 10) is then set to the inverse of brightness. The resulting effect is that for each one of the grid blocks the block moves in and out as the brightness changes. Lighter blocks come forward and darker blocks move back. </p>
<p>Flash is magic. Now watch it and freak out.</p>
<div style="border:solid 1px white; margin-bottom:10px">
<div id="swf98511">This movie requires Flash Player 10</div>
<p><script type="text/javascript">
	swfobject.embedSWF("http://philipandrews.org/sandbox/explode/video/Explode.swf", "swf98511", "466", "340", "10.0.0", "", {}, {wmode: "window", menu: "false", quality: "high", bgcolor: "#000000", allowFullScreen: "true"}, {});
</script>
</div>
<p>Apologies to anyone with a slower machine, this swf is fairly cpu intensive. I would also recommend that you install the very latest <a href="http://www.adobe.com/support/flashplayer/downloads.html">flash player</a>(10,0,22,87 ) to ensure you get the best framerate possible.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F05%2F21%2Fpixelated-video-effect%2F&amp;via=philipandrews&amp;text=Pixelated%20video%20effect&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F05%2F21%2Fpixelated-video-effect%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/Vyz5QLuYuGY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/05/21/pixelated-video-effect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Runtime pixel snapping</title>
		<link>http://fatlinesofcode.philipandrews.org/2009/05/12/runtime-pixel-snapping/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2009/05/12/runtime-pixel-snapping/#comments</comments>
		<pubDate>Tue, 12 May 2009 19:58:06 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=157</guid>
		<description><![CDATA[<p>Lets set the scene: your lazy. You got a sweet a design in photoshop and now you need to bring it to life in flash. Now remember your lazy so your going to use flash&#8217;s <a href="http://theflashblog.com/?p=207">PSD importer</a> to import the layers into flash. What a timer saver. Flash has has made movieclips and text layers from the photoshop layers, nice. You hookup some functions and publish the file. But something is wrong, some the text looks a little fuzzy&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Lets set the scene: your lazy. You got a sweet a design in photoshop and now you need to bring it to life in flash. Now remember your lazy so your going to use flash&#8217;s <a href="http://theflashblog.com/?p=207">PSD importer</a> to import the layers into flash. What a timer saver. Flash has has made movieclips and text layers from the photoshop layers, nice. You hookup some functions and publish the file. But something is wrong, some the text looks a little fuzzy and some of the lines are little blurred. You jump back to the fla and check through some of the movieclips. Bah, flash has placed some clips in-between pixels. You&#8217;ve even got the <a href="http://www.peachpit.com/articles/article.aspx?p=1248999&#038;seqNum=5">&#8216;Snap to Pixels&#8217; </a>feature turned on but flash has ignored when doing the import.<br />
This has happened to me countless times and often on a big flash project it can be real drag digging through movieclips trying to find the elusive off-pixel clip. It would great I thought if I had a little pixel pixie to go through my FLA and fix up all the movieclips and textfields. Well I couldn&#8217;t find any pixies or elfs that where willing to work for me so instead I wrote recursive function to do it at runtime.<br />
This script takes in one argument, the base movieclip it then goes through every child of that movieclip and rounds the x and y position to the nearest pixel. So that every stage instance is rendered on a whole pixel. If any of these clips have children if goes through them and rounds their position and so on and so on recursively until it does each movieclip, sprite or textfield in the swf.</p>
<pre class="brush: as3; title: ;">
roundChildren(this)
function roundChildren(base:DisplayObjectContainer):void {
	for (var i:int=0; i&amp;amp;lt;base.numChildren-1; i++) {
		var m:DisplayObject=base.getChildAt(i) as DisplayObject;
		var p:DisplayObjectContainer=base.getChildAt(i) as DisplayObjectContainer;
		if (m) {
			m.x=Math.round(m.x);
			m.y=Math.round(m.y);
			if(p){
				if (p.numChildren&amp;amp;gt;0) {
					roundChildren(p);
				}
			}
		}

	}
}
</pre>
<p>Checkout the example below to see the script in action. The pixel snapping does not effect dynamic text because of the way flash <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#antiAliasType">anti-aliases</a> it. But you can see a big improvement for the static text and vector lines placed inside a movieclip.</p>
<p>
<object width="468" height="100">
<param name="movie" value="http://philipandrews.org/sandbox/pixelpixie/pixie.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="468" height="100" src="http://philipandrews.org/sandbox/pixelpixie/pixie.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F05%2F12%2Fruntime-pixel-snapping%2F&amp;via=philipandrews&amp;text=Runtime%20pixel%20snapping&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F05%2F12%2Fruntime-pixel-snapping%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/_I2lDfShdJ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/05/12/runtime-pixel-snapping/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SWFAddress 2.2 ♥ swfobject 2.0</title>
		<link>http://fatlinesofcode.philipandrews.org/2009/04/02/swfaddress-2-2-and-swfobject-2-0/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2009/04/02/swfaddress-2-2-and-swfobject-2-0/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 22:25:22 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[swfaddress]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=109</guid>
		<description><![CDATA[<p><a href="http://www.asual.com/swfaddress/">SWFAddress</a> is the amazingly easy to use solution for deep linking in flash. Once setup its simply a case of calling <code>SWFAddress.setValue("myfolder")</code> to change the browser location bar and using <code>SWFAddress.getValue()</code>to get the current url when <code>SWFAddressEvent.CHANGE</code> is triggered.<br />
In fact SWFAddress is so simple to use that when something goes wrong it hard to find the problem because there are no options to change. The difficulty I ran into recently was when I upgraded to the latest version&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.asual.com/swfaddress/">SWFAddress</a> is the amazingly easy to use solution for deep linking in flash. Once setup its simply a case of calling <code>SWFAddress.setValue("myfolder")</code> to change the browser location bar and using <code>SWFAddress.getValue()</code>to get the current url when <code>SWFAddressEvent.CHANGE</code> is triggered.<br />
In fact SWFAddress is so simple to use that when something goes wrong it hard to find the problem because there are no options to change. The difficulty I ran into recently was when I upgraded to the latest version 2.2 For an inexplicable reason, swfaddress&#8217;s <code>SWFAddressEvent.CHANGE</code> would no longer trigger.<br />
I finally isolated the issue to how you include the swfaddress &#038; <a href="http://code.google.com/p/swfobject/">swfobject</a> javascripts in your html. The order of includes is extremely important. Swfobject must be included <strong>before</strong> swfaddress, if you using <a href="http://swffit.millermedeiros.com/">swffit</a> add this after swfaddress. Also you <strong>must</strong> add a flash id to swfobject&#8217;s attributes for embedding. Check out the example below for for SWFAddress 2.2, SWFObject 2 and swffit harmony. </p>
<pre class="brush: xml; title: ;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;en&quot; xml:lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;swfaddress.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;swffit.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var flashvars = {};
var params = {};
var attributes = {id:'mainswf'};
swfobject.embedSWF(&quot;main.swf&quot;, &quot;container&quot;, &quot;100%&quot;, &quot;100%&quot;, &quot;9.0.115&quot;,&quot;expressInstall.swf&quot;, flashvars, params, attributes);
swffit.fit(&quot;mainswf&quot;, 960, 580);
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F04%2F02%2Fswfaddress-2-2-and-swfobject-2-0%2F&amp;via=philipandrews&amp;text=SWFAddress%202.2%20%E2%99%A5%20swfobject%202.0&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F04%2F02%2Fswfaddress-2-2-and-swfobject-2-0%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/0f0IosakjTw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/04/02/swfaddress-2-2-and-swfobject-2-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Debugging SWFs within the browser</title>
		<link>http://fatlinesofcode.philipandrews.org/2009/03/28/actionscript-debugging-within-the-browser/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2009/03/28/actionscript-debugging-within-the-browser/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 19:07:59 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://philipandrews.org/blog/?p=51</guid>
		<description><![CDATA[<p><a class="image" href="http://philipandrews.org/blog/wp-content/uploads/2009/03/picture-4.png" style="float:right;padding-left:20px;padding-bottom:20px;padding-top:20px;border:none"><img title="tail -f flashlog.txt" src="http://philipandrews.org/blog/wp-content/uploads/2009/03/picture-4.png" alt="tail -f flashlog.txt" width="180" height="150" /></a>If your anything like me use you use the trace statement feverishly when developing a flash project, the trace output is the available within the flash IDE and debugging is a straightfoward process. The problem I have found with using trace for debugging is when you move the project into a browser environment. I frequently find that the swf functions slightly different or there are bugs which cause the swf to silently die. There is however a great solution for&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a class="image" href="http://philipandrews.org/blog/wp-content/uploads/2009/03/picture-4.png" style="float:right;padding-left:20px;padding-bottom:20px;padding-top:20px;border:none"><img title="tail -f flashlog.txt" src="http://philipandrews.org/blog/wp-content/uploads/2009/03/picture-4.png" alt="tail -f flashlog.txt" width="180" height="150" /></a>If your anything like me use you use the trace statement feverishly when developing a flash project, the trace output is the available within the flash IDE and debugging is a straightfoward process. The problem I have found with using trace for debugging is when you move the project into a browser environment. I frequently find that the swf functions slightly different or there are bugs which cause the swf to silently die. There is however a great solution for viewing the trace statements from the browser.</p>
<p>First you&#8217;ll need to download and install flash debugger <a href="http://www.adobe.com/support/flashplayer/downloads.html">flash player 10 debugger</a>.</p>
<p>Create a file named “mm.cfg” ( if it does not exist) in one of the following locations:</p>
<ul>
<li>Windows; <code>C:Documents and Settings<em>username</em>mm.cfg</code></li>
<li>OSX; <code>/Library/Application Support/Macromedia/mm.cfg</code></li>
<li>Linux; <code>home/<em>username</em>/mm.cfg</code></li>
</ul>
<p>Open the newly created mm.cfg file in a text editor and add the following text:<br />
<code>ErrorReportingEnable=1<br />
TraceOutputFileEnable=1</code></p>
<p>Reboot your machine.</p>
<p>Browser debugging should be now enabled. All trace statements from any swf will be outputted to the file /Users/[username]/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt</p>
<p>Open a flash site, then look at the file and you&#8217;ll see all the traces coming from the swf.</p>
<p>Personally I find opening this file each time annoying so I use the tail -f command from the terminal so I can follow the file and see live trace outputs.</p>
<p><a href="http://philipandrews.org/blog/wp-content/uploads/2009/03/picture-4.png">tail -f /Users/phil/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt</a></p>
<p>Check this <a href="http://labs.distriqt.com/post/415" target="_blank">blog</a> for an <a href="http://labs.distriqt.com/post/415" target="_blank">explanation</a> the technique customised for windows.</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F03%2F28%2Factionscript-debugging-within-the-browser%2F&amp;via=philipandrews&amp;text=Debugging%20SWFs%20within%20the%20browser&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2009%2F03%2F28%2Factionscript-debugging-within-the-browser%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/-wMnAHiHqyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/03/28/actionscript-debugging-within-the-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Water droplet effect</title>
		<link>http://fatlinesofcode.philipandrews.org/2008/11/20/water-droplet-effect/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2008/11/20/water-droplet-effect/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 07:54:26 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[Flash blogs]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://philipandrews.org/blog/?p=44</guid>
		<description><![CDATA[<p><a class="image"  href="http://philipandrews.org/sandbox/displacement/rain.html" target="_blank"><img class="alignnone size-full wp-image-46" title="drops1" src="http://philipandrews.org/blog/wp-content/uploads/2008/11/drops1.jpg" alt="" style="border: solid 2px #FFFFFF;width:450px" width="440" height="325" /></a></p>
<p>This is an example of how to use the actionscript displacement filter and bitmapData to create a sliding water droplet effect.</p>
<p><a href="http://philipandrews.org/sandbox/displacement/rain.html" target="_blank">example here</a></p>
<p><a href="http://philipandrews.org/sandbox/displacement/">actionscript 3 source here</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a class="image"  href="http://philipandrews.org/sandbox/displacement/rain.html" target="_blank"><img class="alignnone size-full wp-image-46" title="drops1" src="http://philipandrews.org/blog/wp-content/uploads/2008/11/drops1.jpg" alt="" style="border: solid 2px #FFFFFF;width:450px" width="440" height="325" /></a></p>
<p>This is an example of how to use the actionscript displacement filter and bitmapData to create a sliding water droplet effect.</p>
<p><a href="http://philipandrews.org/sandbox/displacement/rain.html" target="_blank">example here</a></p>
<p><a href="http://philipandrews.org/sandbox/displacement/">actionscript 3 source here</a></p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2008%2F11%2F20%2Fwater-droplet-effect%2F&amp;via=philipandrews&amp;text=Water%20droplet%20effect&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2008%2F11%2F20%2Fwater-droplet-effect%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/1P9M2HfXYog" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2008/11/20/water-droplet-effect/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash 3D models</title>
		<link>http://fatlinesofcode.philipandrews.org/2008/09/16/flash-3d-models/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2008/09/16/flash-3d-models/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 05:33:59 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[Flash blogs]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://philipandrews.org/blog/?p=40</guid>
		<description><![CDATA[<p style="text-align: center;"><a style="border:none" href="http://philipandrews.org/sandbox/3dmodel/3dmodel.html" target="_blank"><img class="aligncenter size-full wp-image-41" title="tank" src="http://philipandrews.org/blog/wp-content/uploads/2008/09/tank.jpg" alt="" width="353" height="284" /></a></p>
I've been playing around with latest version of <a href="http://blog.papervision3d.org/">Papervision</a>. I found this great <a href="http://papervision2.com/loading-complex-models/">tutorial</a> on how to load Collada mesh models. Here is a little <a href="http://philipandrews.org/sandbox/3dmodel/3dmodel.html">swf</a> I mashed up. It uses 2 collada models but groups them together as one object with actionscript. <a href="http://code.google.com/p/tweener/">Tweener</a> is used to control the animation and mouse events. You view the AS source and DAE model files <a href="http://philipandrews.org/sandbox/3dmodel/">here</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a style="border:none" href="http://philipandrews.org/sandbox/3dmodel/3dmodel.html" target="_blank"><img class="aligncenter size-full wp-image-41" title="tank" src="http://philipandrews.org/blog/wp-content/uploads/2008/09/tank.jpg" alt="" width="353" height="284" /></a></p>
<p>I&#8217;ve been playing around with latest version of <a href="http://blog.papervision3d.org/">Papervision</a>. I found this great <a href="http://papervision2.com/loading-complex-models/">tutorial</a> on how to load Collada mesh models. Here is a little <a href="http://philipandrews.org/sandbox/3dmodel/3dmodel.html">swf</a> I mashed up. It uses 2 collada models but groups them together as one object with actionscript. <a href="http://code.google.com/p/tweener/">Tweener</a> is used to control the animation and mouse events. You view the AS source and DAE model files <a href="http://philipandrews.org/sandbox/3dmodel/">here</a>.</p>
<p>
<object width="468" height="340">
<param name="movie" value="http://philipandrews.org/sandbox/3dmodel/3dmodel.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#1a1a1a"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="468" height="340" src="http://philipandrews.org/sandbox/3dmodel/3dmodel.swf" quality="high" bgcolor="#1a1a1a" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<div class="tw_button" style=";float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2008%2F09%2F16%2Fflash-3d-models%2F&amp;via=philipandrews&amp;text=Flash%203D%20models&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ffatlinesofcode.philipandrews.org%2F2008%2F09%2F16%2Fflash-3d-models%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://fatlinesofcode.philipandrews.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><img src="http://feeds.feedburner.com/~r/FatLinesOfCode/~4/QADfh-VqlNs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2008/09/16/flash-3d-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
