<?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>Sugarpill Factory Blog</title>
	<atom:link href="http://blog.sugarpillfactory.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.sugarpillfactory.com</link>
	<description>Sugarpill Factory Design, Development and Deployment</description>
	<lastBuildDate>Mon, 10 May 2010 06:44:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Actionscript 3 + PHP Simple Stock Ticker Class</title>
		<link>http://blog.sugarpillfactory.com/?p=396</link>
		<comments>http://blog.sugarpillfactory.com/?p=396#comments</comments>
		<pubDate>Fri, 26 Feb 2010 20:20:56 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=396</guid>
		<description><![CDATA[Add a stock ticker to your script with this easy to use class.
This is the code in the Ticker.as class

package com.atJascha{
	import flash.text.*;
	import flash.net.*;
	import flash.display.*;
	import flash.utils.*;
	import flash.events.*;

	public class Ticker extends Sprite {

		private var _updateTimer:Timer;
		private var _dataPath:String;
		private var _stockSymbol:String;
		private var _stockInfo:String;
		private var _parseArray:Array;
		private var _dataField:TextField;

		public function Ticker(dataPath:String, stockSymbol:String) {

			_dataPath=dataPath;
			_stockSymbol=stockSymbol;
			_stockInfo="s="+_stockSymbol+"&#038;f=noghl1p2vs"; // to see what these symbols mean click [...]]]></description>
			<content:encoded><![CDATA[<p>Add a stock ticker to your script with this easy to use class.</p>
<p>This is the code in the Ticker.as class</p>
<pre style="overflow: auto; width: 380px; background-color: #ffffff;">
package com.atJascha{
	import flash.text.*;
	import flash.net.*;
	import flash.display.*;
	import flash.utils.*;
	import flash.events.*;

	public class Ticker extends Sprite {

		private var _updateTimer:Timer;
		private var _dataPath:String;
		private var _stockSymbol:String;
		private var _stockInfo:String;
		private var _parseArray:Array;
		private var _dataField:TextField;

		public function Ticker(dataPath:String, stockSymbol:String) {

			_dataPath=dataPath;
			_stockSymbol=stockSymbol;
			_stockInfo="s="+_stockSymbol+"&#038;f=noghl1p2vs"; // to see what these symbols mean <a href="http://www.codeproject.com/KB/aspnet/StockQuote.aspx">click here</a>

			_updateTimer = new Timer(10000);
			_updateTimer.addEventListener(TimerEvent.TIMER, getQuote);
			_updateTimer.start();

			var e:Event;
			getQuote(e);
			buildStock();

		}
		private function getQuote(e:Event):void {
			var variables:URLVariables = new URLVariables();
			variables.info=_stockInfo;

			var urlRequest:URLRequest=new URLRequest(_dataPath);
			urlRequest.method=URLRequestMethod.POST;
			urlRequest.data=variables;

			var stockLoader:URLLoader = new URLLoader();
			stockLoader.load(urlRequest);
			stockLoader.addEventListener(Event.COMPLETE, addStock);
			stockLoader.addEventListener(IOErrorEvent.IO_ERROR, IOErrorHandler);
		}
		private function IOErrorHandler(e:Event):void {
			getQuote(e);
		}
		private function addStock(e:Event):void {
			var array:Array=e.target.data.split("\n");
			array.pop();
			var parseArray:Array = new Array();
			for (var i:int=0; i&lt;array.length; i++) {
				var s:String=array[i].substr(0,array[i].indexOf("\n")-1);
				var nArray:Array=s.split(",");

				for (var con:int = 0; con&lt;nArray.length; con++) {
					parseArray.push(nArray[con]);
				}
			}
			updateQuote(parseArray);
		}
		private function updateQuote(parseArray:Array):void
		{
			var textFormat:TextFormat = new TextFormat;
			textFormat.size = 20;
			textFormat.font = "Tahoma";

			_dataField.text =  parseArray[0] + "\n";
			_dataField.text += "Open: " + parseArray[1] + "\n";
			_dataField.text += "Day's Low: " + parseArray[2] + "\n";
			_dataField.text += "Day's High: " + parseArray[3] + "\n";
			_dataField.text += "Last Trade Prce: " + parseArray[4] + "\n";
			_dataField.text += "Change: " + parseArray[5] + "\n";
			_dataField.text += "Volume: " + parseArray[6] + "\n";
			_dataField.text += "Symbol: " + parseArray[7] + "\n";
			_dataField.setTextFormat(textFormat);

		}

			/*  STOCK ARRAY ORDER ...
			* [0]n = name
			* [1]o = open
			* [2]g = day low
			* [3]h = day high
			* [4]l1 = last trade price
			* [5]p2 = change in percent
			* [6]v = volume
			* [7]s = symbol
			*
			*/

		private function buildStock():void
		{

			var bg:Sprite = new Sprite();
			bg.graphics.beginFill(0xEEEEEE);
			bg.graphics.drawRect(0,0,300,200);
			bg.graphics.endFill();
			addChild(bg);

			_dataField = new TextField();
			_dataField.multiline = true;
			_dataField.autoSize = TextFieldAutoSize.LEFT;
			bg.addChild(_dataField);
		}
	}
}
</pre>
<p>You invoke it in your document class with this code:</p>
<pre style="overflow: auto; width: 380px; background-color: #ffffff;">
import com.atJascha.*;
var ticker:Ticker = new Ticker("getDow.php", "GE");  // parameters are path to the php file and then your stock symbol.
addChild(ticker);
</pre>
<p>The php is even simpler:</p>
<pre style="overflow: auto; width: 380px; background-color: #ffffff;">
&lt;?php
$stock = require("http://download.finance.yahoo.com/d/quotes.csv?". $_POST['info']);
echo $stock;
?&gt;
</pre>
<p>that&#8217;s that!<br />
It could use some formatting and love, but ultimately you get your info.<br />
Download the source code <a href="http://blog.sugarpillfactory.com/wp-content/downloads/StockTicker.zip">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=396</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Full Circle Exchange Launched!</title>
		<link>http://blog.sugarpillfactory.com/?p=390</link>
		<comments>http://blog.sugarpillfactory.com/?p=390#comments</comments>
		<pubDate>Wed, 24 Feb 2010 19:55:28 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=390</guid>
		<description><![CDATA[After hours of toil we, along with We Are Sew Creative have finally come to launch Full Circle Exchange.  Please show some love and support by visiting the site and sending some feedback our way!  
]]></description>
			<content:encoded><![CDATA[<p>After hours of toil we, along with <a title="We Are Sew Creative" href="http://wearesewcreative.com">We Are Sew Creative</a> have finally come to launch <a href="http://fullcircleexchange.com">Full Circle Exchange</a>.  Please show some love and support by visiting the site and sending some feedback our way!  <a href="http://fullcircleexchange.com"><img class="aligncenter size-medium wp-image-393" title="Full Circle Exchange" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-24-at-11.54.32-AM1-300x228.png" alt="Full Circle Exchange" width="300" height="228" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=390</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Totaly Tuesday</title>
		<link>http://blog.sugarpillfactory.com/?p=381</link>
		<comments>http://blog.sugarpillfactory.com/?p=381#comments</comments>
		<pubDate>Wed, 24 Feb 2010 02:23:48 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[offtopic]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=381</guid>
		<description><![CDATA[My list of helpful links of the week.
Favicon generator.
Prevent memory leaks in your AS3 by removing anonymous event listeners.
Get rid of those ugly url&#8217;s with mod_rewrite. 
Awesome digital art resource site.
Don&#8217;t be afraid of CSS3.
Awesome collection of rad letterheads. 
Geeky cool programmatic cloth simulation.
Really really geeky list of work stations.  I had to look [...]]]></description>
			<content:encoded><![CDATA[<p>My list of helpful links of the week.</p>
<p><a href="http://www.chami.com/html-kit/services/favicon/">Favicon generator</a>.</p>
<p>Prevent memory leaks in your AS3 by <a href="http://life.neophi.com/danielr/2006/12/removing_anonymous_event_liste.html">removing anonymous event listeners</a>.</p>
<p>Get rid of those ugly url&#8217;s with <a href="http://www.workingwith.me.uk/articles/scripting/mod_rewrite">mod_rewrite</a>. </p>
<p>Awesome <a href="http://www.designshard.com/">digital art resource</a> site.</p>
<p>Don&#8217;t be afraid of <a href="http://designinformer.com/use-css3-now/">CSS3</a>.</p>
<p>Awesome <a href="http://www.letterheady.com/">collection of rad letterheads</a>. </p>
<p>Geeky cool <a href="http://www.andrew-hoyer.com/experiments/cloth">programmatic cloth simulation</a>.</p>
<p>Really really <a href="http://www.webdesigndev.com/roundups/50-awesome-and-creative-web-designer-workspace-setups">geeky list of work stations</a>.  I had to look through the whole thing and then dream about submitting mine one day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=381</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Style Variable Height Background Image Actionscript 3 Class</title>
		<link>http://blog.sugarpillfactory.com/?p=361</link>
		<comments>http://blog.sugarpillfactory.com/?p=361#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:17:44 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=361</guid>
		<description><![CDATA[This a background with a variable height like you see in a lot of css styled page layouts.  It&#8217;s an effective way of presenting information in a fun, clean and organized fashion.  It&#8217;s a pretty simple class, but still an hour or two of work, hopefully using it will save you some time.
This can be [...]]]></description>
			<content:encoded><![CDATA[<p>This a background with a variable height like you see in a lot of css styled page layouts.  It&#8217;s an effective way of presenting information in a fun, clean and organized fashion.  It&#8217;s a pretty simple class, but still an hour or two of work, hopefully using it will save you some time.</p>
<p>This can be used anytime you wish to add a background element to variable height content.</p>
<p>First the images I used in this example (can be replaced by any).</p>
<p style="text-align: center;"><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/paper_top.png"><img class="aligncenter size-medium wp-image-362" title="paper_top" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/paper_top-300x82.png" alt="" width="300" height="82" /></a>The top of the content&#8230;</p>
<p style="text-align: center;"><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/paper_middle.png"><img class="aligncenter size-medium wp-image-363" title="paper_middle" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/paper_middle-300x18.png" alt="" width="300" height="18" /></a>The middle (expanding) part&#8230;</p>
<p style="text-align: center;"><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/paper_bottom.png"><img class="aligncenter size-medium wp-image-364" title="paper_bottom" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/paper_bottom-300x18.png" alt="" width="300" height="18" /></a>And the bottom&#8230;</p>
<p style="text-align: left;">First thing I like to do when I write classes in Actionscript is write some static classes that contain a list of general purpose constants and settings.  This helps me organize so that all of my images, colors, and sizes are in one place and easy to get to later if I feel like making changes.</p>
<p style="text-align: left;">This is my Image.as class.</p>
<pre>package com.atJascha{
  public class Images {
   public static const POST_TOP_IMAGE:String="images/paper_top.png";
   public static const POST_MIDDLE_IMAGE:String="images/paper_middle.png";
   public static const POST_BOTTOM_IMAGE:String="images/paper_bottom.png";
}
}</pre>
<p>(Keep in mind the paths have to be local to YOUR compiled .swf file.)</p>
<p>So, now I have my image path constants set.  So long as I import com.atJascha.*; any of these variables are available to me simply by writing:</p>
<pre style="overflow: auto; width: 380px; background-color: #ffffff;">trace(Images.POST_MIDDLE_IMAGE); // prints "images/paper_bottom.png"</pre>
<p>Now for the working class.</p>
<pre>package com.atJascha{

 /*
 *  Expanding Background Class
 *  by Jascha Rynek
 *  http://blog.sugarpillfactory.com
 */

 import flash.display.*;
 import flash.net.*;
 import flash.events.*;

 public class PostBackground extends Sprite{

 private var _middleHeight:Number; // Remaining Height
 private var _top:Bitmap; // top image reference
 private var _middle:Bitmap; // middle image reference
 private var _bottom:Bitmap; // bottom image reference

 public function PostBackground(height:int){

 _middleHeight = height; // set overall height

 var topLoader:Loader = new Loader();
 topLoader.load(new URLRequest(Images.POST_TOP_IMAGE)); // load top image
 topLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addTop);
 }
 private function addTop(e:Event):void
 {
 _top = e.target.content; // set top image reference

 var bottomLoader:Loader = new Loader();
 bottomLoader.load(new URLRequest(Images.POST_BOTTOM_IMAGE));  // load bottom image
 bottomLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addBottom);
 }
 private function addBottom(e:Event):void
 {
 _bottom = e.target.content; // set bottom image reference
 _middleHeight -= _bottom.height + _top.height; // set remaining height

 if(_middleHeight &gt; 0){ // if remaining height is greater than current pieces, add middle piece
 var middleLoader:Loader = new Loader();
 middleLoader.load(new URLRequest(Images.POST_MIDDLE_IMAGE)); // load middle image
 middleLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addMiddle);
 }else{ // else add top and bottom
 addChild(_top); // add top to stage
 addChild(_bottom);
 _bottom.y = this.height;// add the bottom image and set y to the bottom of the image.
 }
 }
 private function addMiddle(e:Event):void
 {
 addChild(_top); // add top to stage

 _middle = e.target.content;
 addChild(_middle); // add middle to stage
 _middle.y = _top.height; // set middel y position
 _middleHeight -= _middle.height; // set remaining height

 if(_middleHeight&gt;0){
 var times:Number = Math.ceil(_middleHeight/_middle.height);
 /* if there is still more height, figure out how many times the middle piece
 will fit into the remainder*/
 for(var i:int=0;i&lt;times;i++){ // *s the amount of times the middle fits into the remainder
 var bData:BitmapData = _middle.bitmapData;
 var bMap:Bitmap = new Bitmap(bData);
 addChild(bMap); // add the copied middle image
 bMap.y = this.height; // set the copied middle image to the correct y position
 }
 }
 addChild(_bottom);
 _bottom.y = this.height;// add the bottom image and set y to the bottom of the image.

 }
 }
}</pre>
<p>Implementing this class is very simple, you only need to pass one &#8220;height&#8221; paramater.. (assuming you know your content width should match the width of your background images.)</p>
<pre style="overflow: auto; width: 380px; background-color: #ffffff;">import com.atJascha.*;

var bg:PostBackground = new PostBackground(this.height);
addChild(bg);
</pre>
<p>Your results should be something like this&#8230;<br />
<a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-21-at-9.12.47-AM.png"><img class="aligncenter size-medium wp-image-371" title="Screen shot 2010-02-21 at 9.12.47 AM" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-21-at-9.12.47-AM-300x150.png" alt="" width="300" height="150" /></a><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-21-at-9.17.06-AM.png"><img class="aligncenter size-medium wp-image-373" title="Screen shot 2010-02-21 at 9.17.06 AM" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-21-at-9.17.06-AM-300x261.png" alt="" width="300" height="261" /></a></p>
<p><a href="http://blog.sugarpillfactory.com/wp-content/downloads/PostBackground.zip">Download working example of Variable Height Actionscript 3 Class</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=361</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuesday! (the name of today)</title>
		<link>http://blog.sugarpillfactory.com/?p=358</link>
		<comments>http://blog.sugarpillfactory.com/?p=358#comments</comments>
		<pubDate>Tue, 16 Feb 2010 15:29:15 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[offtopic]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=358</guid>
		<description><![CDATA[Another busy week.  Found a couple great code helping sites.
Great tips on improving your designs.
Hilarious list of comments in code.  BTW if you don&#8217;t know about Stackoverflow.com you should!
Awesome clothing collection to support iPad enthusiasts.
If you are a web developer, this is one of the coolest tools you can find. It&#8217;s called IE tester and [...]]]></description>
			<content:encoded><![CDATA[<p>Another busy week.  Found a couple great code helping sites.</p>
<p>Great tips on <a title="Drastically Improve Your Designs" href="http://designinformer.com/how-to-drastically-improve-your-designs/">improving your designs</a>.</p>
<p>Hilarious list of <a title="Code Comments" href="http://stackoverflow.com/questions/184618?sort=votes">comments in code</a>.  BTW if you don&#8217;t know about <a title="Stackoverflow.com" href="http://stackoverflow.com/">Stackoverflow.com</a> you should!</p>
<p>Awesome <a title="iPad Pants" href="http://www.ohnodoom.com/ibap/">clothing collection</a> to support iPad enthusiasts.</p>
<p>If you are a web developer, this is one of the coolest tools you can find. It&#8217;s called <a title="IE Tester" href="http://www.my-debugbar.com/wiki/IETester/HomePage">IE tester</a> and it lets you run from IE 5.5-IE 8 in one browser window.</p>
<p>Ever curious why your how to initialize your <code>public static const</code> without instantiating an object in Actionscript 3?  <a title="Kaioa.com" href="http://kaioa.com/node/100">Kaio</a> gives some pointers.</p>
<p>Great article on one man&#8217;s opinion on <a title="The Future of Web Content" href="http://techcrunch.com/2010/02/05/the-future-of-web-content-html5-flash-mobile-apps/">the future of HTML 5, Flash, Javascript</a> and the like.</p>
<p>If you&#8217;re looking for a <a title="Snippir.com" href="http://snipplr.com/">Javascript, Actionscript or PHP code snippet</a>&#8230; this is the place.</p>
<p><a title="Komodo Media" href="http://www.komodomedia.com">This guy</a> is one hell of  a web developer.</p>
<p><a title="Cufon Font Generator" href="http://cufon.shoqolate.com/generate/">Blog font generator</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=358</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codular to Ocoular in Under 5 Gazoombas</title>
		<link>http://blog.sugarpillfactory.com/?p=352</link>
		<comments>http://blog.sugarpillfactory.com/?p=352#comments</comments>
		<pubDate>Tue, 16 Feb 2010 05:47:33 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=352</guid>
		<description><![CDATA[I still amazes me that this&#8230;

Turns into this&#8230;
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">I still amazes me that this&#8230;<br />
<a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-15-at-9.41.24-PM.png"><img class="aligncenter size-medium wp-image-353" title="Actionscript" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-15-at-9.41.24-PM-250x300.png" alt="Actionscript" width="250" height="300" /></a><br />
Turns into this&#8230;<a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-15-at-9.45.23-PM.png"><img class="aligncenter size-medium wp-image-354" title="Flash" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-15-at-9.45.23-PM-300x300.png" alt="Flash" width="300" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=352</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working On An All Flash (Actionscript 3) Wordpress Theme</title>
		<link>http://blog.sugarpillfactory.com/?p=349</link>
		<comments>http://blog.sugarpillfactory.com/?p=349#comments</comments>
		<pubDate>Mon, 15 Feb 2010 06:30:28 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=349</guid>
		<description><![CDATA[I&#8217;ve spent the better part of valentines weekend slaving away to bring YOU a fully integrated flash front end for your wordpress backend.  It WILL be fully functional, it WILL be a theme ready to plug and play, it WILL be customizable, it WILL be ALL flash, it will NOT be EASY.  I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent the better part of valentines weekend slaving away to bring YOU a fully integrated flash front end for your wordpress backend.  It WILL be fully functional, it WILL be a theme ready to plug and play, it WILL be customizable, it WILL be ALL flash, it will NOT be EASY.  I still have quite a few dilemas to sort out.  Like, how in the world am I gonna make the widgets plug in seamlessly.  That is YTBD.  Anyway, here is a screen shot.  If you have any suggestions or comments about what YOU would like to see out of a flash Actionscript 3 wordpress template, feel free to drop a note.<br />
<div id="attachment_350" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-14-at-10.25.36-PM.png"><img src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-14-at-10.25.36-PM-300x205.png" alt="Actionscript 3 Flash Wordpress Theme" title="Actionscript 3 Flash Wordpress Theme" width="300" height="205" class="size-medium wp-image-350" /></a><p class="wp-caption-text">Actionscript 3 Flash Wordpress Theme</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=349</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript 3 Ascii Art Class</title>
		<link>http://blog.sugarpillfactory.com/?p=332</link>
		<comments>http://blog.sugarpillfactory.com/?p=332#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:35:34 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=332</guid>
		<description><![CDATA[Create fun Ascii Art with this easy to use class&#8230;
Download source code: Actionscript ASCII Art Class
Invoke the class like so:

var bitMapData:BMap2 = new BMap2(0,0); // THIS WOULD BE YOUR IMAGE DATA
var art:AsciiArt = new AsciiArt(bitMapData, 4,"#", "*", "."); //after bitMapData are optional fields
// detail:int(pixel sample rate)
//	dark:String(dark pixel character),
// medium:String(medium pixel character),
// light :String(light pixel character)
addChild(art);

Here [...]]]></description>
			<content:encoded><![CDATA[<p>Create fun Ascii Art with this easy to use class&#8230;</p>
<p>Download source code: <a title="ASCII Art Class" href="http://www.sugarpillfactory.com/blog/wp-content/downloads/AsciiArt.zip">Actionscript ASCII Art Class</a></p>
<p>Invoke the class like so:</p>
<div style="font-size: 8px;">
<p><code>var bitMapData:BMap2 = new BMap2(0,0); // THIS WOULD BE YOUR IMAGE DATA<br />
var art:AsciiArt = new AsciiArt(bitMapData, 4,"#", "*", "."); //after bitMapData are optional fields<br />
// detail:int(pixel sample rate)<br />
//	dark:String(dark pixel character),<br />
// medium:String(medium pixel character),<br />
// light :String(light pixel character)<br />
addChild(art);</code></p>
</div>
<p>Here is the class script:</p>
<div style="font-size: 8px;"><code><br />
package<br />
{<br />
import flash.display.*;<br />
import flash.text.*;<br />
public class AsciiArt extends Sprite<br />
{<br />
private var detail:int = 5; // This is your pixel sample rate (smaller number means more pixels sampled)<br />
private var imgData:BitmapData;<br />
private var xPos:int = 0;<br />
private var yPos:int = 0;<br />
private var lightPixel:String;  // The Character that comes up for light areas<br />
private var mediumPixel:String; // Same for Medium<br />
private var darkPixel:String; // I think you get it by now<br />
private var channel:int = 0; // Channel to sample 0 = Red 1 = Blue 2 = Green<br />
public function AsciiArt(imageData:BitmapData, sampleRate:int = 5, dark:String  = "%", medium:String  = "*", light:String = ".")<br />
{<br />
detail = sampleRate;<br />
darkPixel = dark;<br />
mediumPixel = medium;<br />
lightPixel = light;<br />
imgData = imageData;<br />
makeArt();<br />
}<br />
private function makeArt()<br />
{<br />
for(var i:int=0; i&lt;imgData.width/detail;i++){<br />
var color:uint= imgData.getPixel(xPos,yPos);<br />
var t:TextField = new TextField();<br />
addChild(t);<br />
var colors:Array = HexToRGB(color);<br />
if(colors[channel]&gt;200){<br />
// LIGHT COLOR<br />
t.x = xPos;<br />
t.y = yPos;<br />
t.text = lightPixel;<br />
}else if(colors[channel]&lt;199 &amp;&amp; colors[channel]&gt;60){<br />
// DARK COLOR<br />
t.x = xPos;<br />
t.y = yPos;<br />
t.text = mediumPixel;<br />
}else{<br />
// DARK COLOR<br />
t.x = xPos;<br />
t.y = yPos;<br />
t.text = darkPixel;<br />
}<br />
xPos += detail; // Add detail width to sample position<br />
}<br />
if(yPos&lt;imgData.height){ // if yPos is less than the height of the image, start over again<br />
xPos = 0;<br />
yPos +=detail;<br />
makeArt();<br />
}<br />
}<br />
private function HexToRGB(hex:uint):Array // function lifted from http://blog.mindfock.com/rgb-to-hexadecimal-to-hsv-conversion-in-as3/<br />
{<br />
var rgb:Array = [];<br />
var r:uint = hex &gt;&gt; 16 &amp; 0xFF;<br />
var g:uint = hex &gt;&gt; 8 &amp; 0xFF;<br />
var b:uint = hex &amp; 0xFF;<br />
rgb.push(r, g, b);<br />
return rgb;<br />
}<br />
}<br />
}<br />
</code></p>
</div>
<p>and here is a screen cap of the output:</p>
<div id="attachment_333" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-11-at-12.45.04-PM.png"><img class="aligncenter size-medium wp-image-340" title="Actionscript 3 Acii Art Image" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-11-at-12.45.04-PM-300x225.png" alt="Actionscript 3 Acii Art Image" width="300" height="225" /></a><p class="wp-caption-text">Ascii Art Actionscript 3</p></div>
<div id="attachment_342" class="wp-caption aligncenter" style="width: 255px"><a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-11-at-1.00.34-PM.png"><img class="size-medium wp-image-342" title="Actionscript 3 Ascii Art Marilyn Monroe" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-11-at-1.00.34-PM-245x300.png" alt="" width="245" height="300" /></a><p class="wp-caption-text">Actionscript 3 Ascii Art Marilyn Monroe</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=332</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ENHANCE!</title>
		<link>http://blog.sugarpillfactory.com/?p=326</link>
		<comments>http://blog.sugarpillfactory.com/?p=326#comments</comments>
		<pubDate>Wed, 10 Feb 2010 15:43:00 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[offtopic]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=326</guid>
		<description><![CDATA[This is why many clients ask for photopgraphs to be rotated in 3d space.  (If you are wondering, it is NOT possible.)

]]></description>
			<content:encoded><![CDATA[<p>This is why many clients ask for photopgraphs to be rotated in 3d space.  (If you are wondering, it is NOT possible.)</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="365" height="224" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Vxq9yj2pVWk&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="365" height="224" src="http://www.youtube.com/v/Vxq9yj2pVWk&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=326</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terrible Tuesday</title>
		<link>http://blog.sugarpillfactory.com/?p=323</link>
		<comments>http://blog.sugarpillfactory.com/?p=323#comments</comments>
		<pubDate>Tue, 09 Feb 2010 16:39:42 +0000</pubDate>
		<dc:creator>Mr. JASCHA L RYNEK</dc:creator>
				<category><![CDATA[offtopic]]></category>

		<guid isPermaLink="false">http://blog.sugarpillfactory.com/?p=323</guid>
		<description><![CDATA[Not many links today, been a busy week getting the CMS of the Full Circle Exchange website dialed in.Here we go!
Some simple desktops for peace of mind.
Fall of the IEmpire!
Change up your FireFox theme.
Awesome Ajax.
Do you know Glennz? You should.
I don&#8217;t like James Cameron, finally someone smart enough pointed out why.
Make your UI doper.
-J
]]></description>
			<content:encoded><![CDATA[<p>Not many links today, been a busy week getting the CMS of the Full Circle Exchange website dialed in.<a href="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-08-at-6.56.03-PM.png"><img class="aligncenter size-medium wp-image-324" title="Screen shot 2010-02-08 at 6.56.03 PM" src="http://blog.sugarpillfactory.com/wp-content/uploads/2010/02/Screen-shot-2010-02-08-at-6.56.03-PM-300x44.png" alt="" width="300" height="44" /></a>Here we go!</p>
<p>Some <a title="Simple Desktops" href="http://simpledesktops.com/browse/photos/">simple desktops</a> for peace of mind.</p>
<p>Fall of the <a title="Internet Explorer Share Falling" href="http://techcrunch.com/2010/02/02/internet-explorer-browser-share/">IEmpire!</a></p>
<p>Change up your <a title="Firefox Browser Themes" href="https://addons.mozilla.org/en-US/firefox/browse/type:2/cat:all?sort=popular">FireFox</a> theme.</p>
<p>Awesome <a title="Dynamic Ajax" href="http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm">Ajax</a>.</p>
<p>Do you know <a title="Glennz" href="http://www.behance.net/Gallery/Glennz-Tee-Store-Designs/149088">Glennz</a>? You should.</p>
<p>I don&#8217;t like James Cameron, finally someone smart enough <a title="Avatar Review" href="http://www.huffingtonpost.com/2010/02/01/the-best-review-of-avatar_n_444305.html">pointed out why</a>.</p>
<p>Make your <a title="UI Design Tips" href="http://www.usabilitypost.com/2008/08/14/using-light-color-and-contrast-effectively-in-ui-design/">UI</a> doper.</p>
<p>-J</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sugarpillfactory.com/?feed=rss2&amp;p=323</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
