<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fat lines of code &#187; actionscript</title>
	<atom:link href="http://fatlinesofcode.philipandrews.org/category/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://fatlinesofcode.philipandrews.org</link>
	<description>100% loaded on actionscipt</description>
	<lastBuildDate>Fri, 23 Jul 2010 12:50:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>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[<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&#8230;</p>]]></description>
			<content:encoded><![CDATA[<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;">
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>
]]></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[drawTriangle]]></category>
		<category><![CDATA[flash10]]></category>

		<guid isPermaLink="false">http://fatlinesofcode.philipandrews.org/?p=393</guid>
		<description><![CDATA[<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 example below to see the points of the rectangle warp to new positions.&#8230;</p>]]></description>
			<content:encoded><![CDATA[<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 example 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><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;">
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;">
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>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2010/06/25/flash-10-drawtriangles/feed/</wfw:commentRss>
		<slash:comments>0</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>

		<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;">
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>
]]></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;">
&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>
]]></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>

		<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>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/10/10/box2d-ballooning/feed/</wfw:commentRss>
		<slash:comments>2</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>

		<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>
<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/videowebcam/Explode.swf", "swf98511", "466", "340", "10.0.0", "", {}, {wmode: "window", menu: "false", quality: "high", bgcolor: "#000000", allowFullScreen: "true"}, {});
</script>
</div>
<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;">
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;">
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;">
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>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/07/13/pixelated-video-effect-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</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>

		<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>
]]></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;">
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>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/05/12/runtime-pixel-snapping/feed/</wfw:commentRss>
		<slash:comments>0</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>

		<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;">
&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>
]]></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>

		<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>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2009/03/28/actionscript-debugging-within-the-browser/feed/</wfw:commentRss>
		<slash:comments>1</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[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>
]]></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[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>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2008/09/16/flash-3d-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paperskate 3D</title>
		<link>http://fatlinesofcode.philipandrews.org/2008/09/06/paperskate-3d/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2008/09/06/paperskate-3d/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 02:22:18 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flash blogs]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[skateboarding]]></category>

		<guid isPermaLink="false">http://philipandrews.org/blog/?p=34</guid>
		<description><![CDATA[<p><a href="http://www.paperskate3d.com/" target="_blank"><img class="aligncenter size-full wp-image-35" title="paperskate" src="http://philipandrews.org/blog/wp-content/uploads/2008/09/paperskate.jpg" alt="" width="440" height="289" /></a></p>
<p>(flash + skateboarding) * 3D = awesomeness</p>
<p>Checkout <a href="http://www.paperskate3d.com/">this</a> awesome little flash game built on papervision 3D. Its a very simple idea but pretty effective, lets hope he keeps the development going and takes it to the next stage. If I was this <a href="http://www.everydayflash.com/blog/index.php/2008/08/18/skateboard-simulator-papervision3d/">dude</a>, I&#8217;d try and market the idea to <a href="http://www.techdeck.com/">Tech Deck</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.paperskate3d.com/" target="_blank"><img class="aligncenter size-full wp-image-35" title="paperskate" src="http://philipandrews.org/blog/wp-content/uploads/2008/09/paperskate.jpg" alt="" width="440" height="289" /></a></p>
<p>(flash + skateboarding) * 3D = awesomeness</p>
<p>Checkout <a href="http://www.paperskate3d.com/">this</a> awesome little flash game built on papervision 3D. Its a very simple idea but pretty effective, lets hope he keeps the development going and takes it to the next stage. If I was this <a href="http://www.everydayflash.com/blog/index.php/2008/08/18/skateboard-simulator-papervision3d/">dude</a>, I&#8217;d try and market the idea to <a href="http://www.techdeck.com/">Tech Deck</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2008/09/06/paperskate-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portfolio idea</title>
		<link>http://fatlinesofcode.philipandrews.org/2008/04/16/portfolio-idea/</link>
		<comments>http://fatlinesofcode.philipandrews.org/2008/04/16/portfolio-idea/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 03:06:17 +0000</pubDate>
		<dc:creator>phil</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flash blogs]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://philipandrews.org/blog/?p=36</guid>
		<description><![CDATA[<p style="text-align: center;"><a href="http://philipandrews.org/sandbox/3dcube/CUBES.html"><img class="aligncenter size-full wp-image-37" title="3dcube" src="http://philipandrews.org/blog/wp-content/uploads/2008/09/3dcube.jpg" alt="" width="365" height="350" /></a></p>
<p>Here is an <a href="http://philipandrews.org/sandbox/3dcube/CUBES.html">idea</a> I had for a portfolio. It&#8217;s a 3D cube built in <a href="http://blog.papervision3d.org/">papervision</a> to view the websites screenshots. The result was a bit naff so I never developed it further. It was a fun use of Papervision3D and as3 though. Papervision is surprisingly easy. Source is <a href="http://philipandrews.org/sandbox/3dcube/CUBE3D.zip">here</a> for anyone that wants it.</p>
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://philipandrews.org/sandbox/3dcube/CUBES.html"><img class="aligncenter size-full wp-image-37" title="3dcube" src="http://philipandrews.org/blog/wp-content/uploads/2008/09/3dcube.jpg" alt="" width="365" height="350" /></a></p>
<p>Here is an <a href="http://philipandrews.org/sandbox/3dcube/CUBES.html">idea</a> I had for a portfolio. It&#8217;s a 3D cube built in <a href="http://blog.papervision3d.org/">papervision</a> to view the websites screenshots. The result was a bit naff so I never developed it further. It was a fun use of Papervision3D and as3 though. Papervision is surprisingly easy. Source is <a href="http://philipandrews.org/sandbox/3dcube/CUBE3D.zip">here</a> for anyone that wants it.</p>
]]></content:encoded>
			<wfw:commentRss>http://fatlinesofcode.philipandrews.org/2008/04/16/portfolio-idea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
