<?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>Mindfock &#187; Classes</title>
	<atom:link href="http://blog.mindfock.com/tag/classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mindfock.com</link>
	<description>Flash and ActionScript for the masses. With a little Python thrown in.</description>
	<lastBuildDate>Wed, 31 Mar 2010 10:07:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Nifty FPS/CPU monitor class</title>
		<link>http://blog.mindfock.com/nifty-fpscpu-monitor-class/</link>
		<comments>http://blog.mindfock.com/nifty-fpscpu-monitor-class/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 04:19:37 +0000</pubDate>
		<dc:creator>John del Rosario</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Programming and Development]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://blog.mindfock.com/?p=51</guid>
		<description><![CDATA[I found this little class that displays the framerate of the current movie and the total memory usage of the Flash Player on your movie. It also shows the version of the player and the operating system you are on. It even has a graph. Very useful for monitoring your experiments or whatever.  Link. If [...]]]></description>
			<content:encoded><![CDATA[<p>I found this little class that displays the framerate of the current movie and the total memory usage of the Flash Player on your movie. It also shows the version of the player and the operating system you are on. It even has a graph. Very useful for monitoring your experiments or whatever. </p>
<p><a title="FPSMonitor class" href="http://www.flashfuck.it/2008/05/27/fpsmonitor-for-as3-and-flex-projects/#comment-68" target="_blank">Link.</a></p>
<p>If anyone knows something better, please let me know. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindfock.com/nifty-fpscpu-monitor-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple TileBG class</title>
		<link>http://blog.mindfock.com/simple-tilebg-class/</link>
		<comments>http://blog.mindfock.com/simple-tilebg-class/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 08:06:59 +0000</pubDate>
		<dc:creator>John del Rosario</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.mindfock.com/?p=39</guid>
		<description><![CDATA[Here is another class I made for my site&#8230; It&#8217;s nothing fancy, and in fact it could easily be done without this class, but basically, this class creates a rectangular object and fills it with an image from an outside source, tiles it, and you could easily adjust the width and height of the object, [...]]]></description>
			<content:encoded><![CDATA[<p>Here is another class I made for my site&#8230; It&#8217;s nothing fancy, and in fact it could easily be done without this class, but basically, this class creates a rectangular object and fills it with an image from an outside source, tiles it, and you could easily adjust the width and height of the object, and load a new pattern.<br />
Usage:</p>
<pre class="brush: jscript;">
import com.mindfock.display.TiledBG; //import class
...
tiledBG = new TiledBG(&quot;path/to/pattern.gif&quot;, 800, 600);
addChild(tiledBG);

tiledBG.tileWidth = 500 // change width
tiledBG.tileHeight = 500 // change height

tiledBG.newPattern(&quot;path/to/new/pattern.gif&quot;); //changing pattern image
</pre>
<p><a href="http://blog.mindfock.com/wp-content/uploads/files/TiledBG.as">Download here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindfock.com/simple-tilebg-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shuffler class</title>
		<link>http://blog.mindfock.com/shuffler-class/</link>
		<comments>http://blog.mindfock.com/shuffler-class/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 10:52:30 +0000</pubDate>
		<dc:creator>John del Rosario</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Experiments]]></category>

		<guid isPermaLink="false">http://blog.mindfock.com/?p=38</guid>
		<description><![CDATA[I&#8217;ve been working on my site for a few weeks now, and I have developed a class that will handle how I display assets on my site. Basically, it &#8220;throws&#8221; in items into the stage, and you could shuffle them around or you could stack them up. I&#8217;ve made it very easy to use, and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on my site for a few weeks now, and I have developed a class that will handle how I display assets on my site.</p>
<p>Basically, it &#8220;throws&#8221; in items into the stage, and you could shuffle them around or you could stack them up. I&#8217;ve made it very easy to use, and it&#8217;s still under development, but I think it&#8217;s ready to be used by others. This is my first class I&#8217;ve ever shared, and though it&#8217;s not much, I hope someone likes it or maybe even use it. <img src='http://blog.mindfock.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>You can use any DisplayObject as the &#8216;items&#8217; of the Shuffler.<br />
There are explanations in the code, but here are some important points</p>
<ul>
<li> shuffle() &#8211; shuffles the items</li>
<li>stack() &#8211; stacks the items</li>
<li>setFocusOn(item:DisplayObject) &#8211; sets the item param as the focused item</li>
<li>addItem(item:DisplayObject) &#8211; adds item param to the shuffler</li>
<li>deleteItem(index:int) &#8211; deletes the item at index</li>
<li>has max property for maximum number of boxes allowed. 0 for infinite.</li>
</ul>
<ul></ul>
<p>Here is an example:<br />

<object	type="application/x-shockwave-flash"
			data="http://www.mindfock.com/experiments/TestShuffler.swf"
			width="400"
			height="300">
	<param name="movie" value="http://www.mindfock.com/experiments/TestShuffler.swf" />
</object>
<p>Sample usage in code:</p>
<pre class="brush: jscript;">
package{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.*;
	import flash.text.TextField;
	import com.mindfock.ui.Shuffler;

	public class TestShuffler extends Sprite{
		private var boxes:Array;
		private var shuffler:Shuffler;
		private var stacker:TextField;
		private var shuffle:TextField;
		private var adder:TextField;

		public function TestShuffler(){
			init();
		}
		public function init():void{
			shuffler = new Shuffler(400, 300, 6);
			createBoxes(6);
			createButtons();
			addChild(shuffler);
		}
		private function createBoxes(num:int):void{
			boxes = new Array();
			for (var i:int = 0; i &lt; num; i++)
			{
				trace(&quot;created&quot;);
				var box:Sprite = drawBox(50, 50) as Sprite;

				boxes.push(box);

				shuffler.addItem(box);
			}
		}
		private function drawBox(w:Number, h:Number):DisplayObject{
			var box:Sprite = new Sprite();
			box.graphics.lineStyle(2, 0x000000);
			box.graphics.beginFill(Math.random() * 16000000);
			box.graphics.drawRect(0, 0, 100, 100);
			box.graphics.endFill();

			return box;
		}
		private function createButtons():void
		{
			// I've left out the drawing of the buttons
			square.addEventListener(MouseEvent.CLICK, shuffleHandler);
			square2.addEventListener(MouseEvent.CLICK, stackHandler);
			square3.addEventListener(MouseEvent.CLICK, addHandler);
		}
		private function shuffleHandler(event:MouseEvent):void{
			shuffler.shuffle();
		}
		private function stackHandler(event:MouseEvent):void{
			shuffler.stack();
		}
		private function addHandler(event:MouseEvent):void{
			var newBox:Sprite = drawBox(50, 50) as Sprite;
			shuffler.addItem(newBox);
		}
	}
}
</pre>
<p><a title="Shuffler class" href="http://www.mindfock.com/classes/Shuffler.as">Download source</a></p>
<p>Just save it in your classpath, under com/mindfock/ui</p>
<p>You need <a title="TweenLite" href="http://blog.greensock.com/tweenliteas3/">TweenLite</a> for the tweening animations&#8230; If you don&#8217;t know what it is, you should look into tweening engines. They will save you a lot of hard work.</p>
<p>Now that I&#8217;ve got the main bulk of my site done, I hope I can finish it before classes start. <img src='http://blog.mindfock.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindfock.com/shuffler-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
