<?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>Is Good Stuff &#187; Useful Scripts</title>
	<atom:link href="http://www.isgoodstuff.com/tag/useful-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.isgoodstuff.com</link>
	<description>For all the good things!</description>
	<lastBuildDate>Mon, 26 Jul 2010 01:38:24 +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>AS3 : Collision Detection Kit</title>
		<link>http://www.isgoodstuff.com/2010/03/30/as3-collision-detection-kit/</link>
		<comments>http://www.isgoodstuff.com/2010/03/30/as3-collision-detection-kit/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 00:55:15 +0000</pubDate>
		<dc:creator>Mr.GoodStuff</dc:creator>
				<category><![CDATA[Articles Submits]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.isgoodstuff.com/?p=565</guid>
		<description><![CDATA[Ever wonder, is there an easier way instead of making loops and check for every hitTest with all sorts of  shapes and sizes? Well, may I present to you &#8211; Collision Detection Kit! The Collision Detection Kit is a package of classes created for pixel-precise, shape-based collision detection for all display objects. It is written [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://www.isgoodstuff.com/wp-content/uploads/2009/09/ActionscriptIcon_400_thumb.png"><img class="alignleft size-full wp-image-485" style="margin-right: 8px;" title="ActionscriptIcon_400_thumb.png" src="http://www.isgoodstuff.com/wp-content/uploads/2009/09/ActionscriptIcon_400_thumb.png" alt="" width="124" height="124" /></a>Ever wonder, is there an easier way instead of making loops and check for every hitTest with all sorts of  shapes and sizes? Well, may I present to you &#8211; <a href="http://code.google.com/p/collisiondetectionkit/">Collision Detection Kit</a>!</p>
<div id="_mcePaste">
<p>The Collision Detection Kit is a package of classes created for pixel-precise, shape-based collision detection for all display objects. It is written in Actionscript 3.0 and meant for Flash Player version 9 and higher.</p>
<p>The Collision Detection Kit comes with several features to control how collisions are detected, and provides data for the user of the class so they can do something about the collision:</p>
</div>
<div id="_mcePaste">
<ul>
<li>Set an alpha threshold to ignore colors below the threshold.</li>
<li>Specify colors and color ranges to exclude from collision detection.</li>
<li>Receive an angle of collision for each collision. We&#8217;re not talking about bounding boxes here &#8211; the angle is calculated based on the shapes of the display objects at the site of the collision. Great for when you&#8217;re working with physics!</li>
<li>Receive the pixels that overlapped in a collision in stage coordinates. Combined with the returned angle, and your physics engine will have no problems traversing complicated shapes or performing off-axis rotation.</li>
<li>Takes transformations (scale, rotation, color transforms, etc.) of individual instances of your display objects into account.</li>
<li>Add items for collision detection regardless of their nesting.</li>
<li>You can have as many CollisionGroup and CollisionList instances as you want, allowing you to easily manage different interactions and behaviors.</li>
<li>Works with all display objects &#8211; MovieClips, Sprites, Bitmaps, TextFields, FLVs, and on and on!</li>
</ul>
</div>
<p><span id="more-565"></span></p>
<p>Check out CDK in action below!</p>
<p><object id="Opening" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ff6600" /><param name="src" value="http://www.isgoodstuff.com/wp-content/uploads/2010/03/Opening.swf" /><param name="name" value="Opening" /><param name="allowfullscreen" value="false" /><embed id="Opening" type="application/x-shockwave-flash" width="550" height="400" src="http://www.isgoodstuff.com/wp-content/uploads/2010/03/Opening.swf" name="Opening" bgcolor="#ff6600" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<div style="text-align:left"><a style="text-align:left" href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/mrss.php?id=565'});">Start Slide Show with PicLens Lite <img src="http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.isgoodstuff.com/2010/03/30/as3-collision-detection-kit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 : Explosion Burst Class</title>
		<link>http://www.isgoodstuff.com/2010/02/11/as3-explosion-burst-class/</link>
		<comments>http://www.isgoodstuff.com/2010/02/11/as3-explosion-burst-class/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 09:27:11 +0000</pubDate>
		<dc:creator>Mr.GoodStuff</dc:creator>
				<category><![CDATA[Articles Submits]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Useful Scripts]]></category>

		<guid isPermaLink="false">http://www.isgoodstuff.com/?p=548</guid>
		<description><![CDATA[Developing games like Shooter in As3 can be boring without good explosion effects. Over the weekends, I ported a simple class ( from As2 )which does some randomized explosion movie-clips. This is to be used when there&#8217;s an explosion in the game. The class allows you to create explosion effect based on number of particles, [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://www.isgoodstuff.com/wp-content/uploads/2009/09/ActionscriptIcon_400_thumb.png"><img class="alignleft size-full wp-image-485" style="margin-right: 8px; margin-bottom: 5px;" title="ActionscriptIcon_400_thumb.png" src="http://www.isgoodstuff.com/wp-content/uploads/2009/09/ActionscriptIcon_400_thumb.png" alt="" width="124" height="124" /></a>Developing games like Shooter in As3 can be boring without good explosion effects. Over the weekends, I ported a simple class ( from As2 )which does some randomized explosion movie-clips.</p>
<p>This is to be used when there&#8217;s an explosion in the game. The class allows you to create explosion effect based on number of particles, size of distance and alpha. All you need is to instantiate it and pass in the variables needed. See sample below.</p>
<div align="center">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.isgoodstuff.com/wp-content/uploads/2010/02/explosionSystemCS3.swf" /><embed type="application/x-shockwave-flash" width="500" height="300" src="http://www.isgoodstuff.com/wp-content/uploads/2010/02/explosionSystemCS3.swf"></embed></object></div>
<p><span id="more-548"></span></p>
<p>Download the <a href="http://www.isgoodstuff.com/wp-content/files/explosionBurst.zip" target="_blank">source here</a>, when you use make sure you have to use the movie-clip from the library folder as well.</p>
<div style="text-align:left"><a style="text-align:left" href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/mrss.php?id=548'});">Start Slide Show with PicLens Lite <img src="http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.isgoodstuff.com/2010/02/11/as3-explosion-burst-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 : Flash-Console</title>
		<link>http://www.isgoodstuff.com/2009/12/04/flash-console/</link>
		<comments>http://www.isgoodstuff.com/2009/12/04/flash-console/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 01:59:50 +0000</pubDate>
		<dc:creator>Mr.GoodStuff</dc:creator>
				<category><![CDATA[Articles Submits]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.isgoodstuff.com/?p=501</guid>
		<description><![CDATA[Every wonder that, there&#8217;s something to display your run-time variables smoothly without using the laggy trace. Not to say trace command is useless, but at times is much less cpu intensive to debug values especially on enterFrame run time to an on screen textbox instead of using trace. But, lately I stumbled upon a good [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://www.isgoodstuff.com/wp-content/uploads/2009/12/console_controls01.png"><img src="http://www.isgoodstuff.com/wp-content/uploads/2009/12/console_controls01.png" alt="console_controls01" title="console_controls01" width="598" height="198" class="alignleft size-full wp-image-523" /></a></p>
<p></br></p>
<p>Every wonder that, there&#8217;s something to display your run-time variables smoothly without using the laggy trace. Not to say trace command is useless, but at times is much less cpu intensive to debug values especially on enterFrame run time to an on screen textbox instead of using trace.</p>
<p>But, lately I stumbled upon a good console interface like debugger called Flash Console in a form of as3 class package! </p>
<p><span id="more-501"></span></p>
<p>Aside from the being able to watch your values real time , it also came with various handy feature such as.</p>
<ul>
<li>Command line</li>
<li>Display info/properties checker (known as Roller)</li>
<li>RunTime Measurement Ruler</li>
</ul>
<p>All you need to do is to import the class into your main.as and attach C (the singleton class) method startOnStage.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">atticmedia</span>.<span style="color: #006600;">console</span>.<span style="color: #006600;">C</span>;
C.<span style="color: #006600;">startOnStage</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// To debug a value</span>
C.<span style="color: #006600;">info</span><span style="color: #66cc66;">&#40;</span>variableName<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>If you are interested click <a href="http://code.google.com/p/flash-console/">here to get it </a>.</p>
<p></br></p>
<div style="text-align:left"><a style="text-align:left" href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/mrss.php?id=501'});">Start Slide Show with PicLens Lite <img src="http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.isgoodstuff.com/2009/12/04/flash-console/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AS3 : FPS and Memory Counter Package</title>
		<link>http://www.isgoodstuff.com/2009/09/26/as3-fps-and-memory-counter-package/</link>
		<comments>http://www.isgoodstuff.com/2009/09/26/as3-fps-and-memory-counter-package/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 19:17:53 +0000</pubDate>
		<dc:creator>Mr.GoodStuff</dc:creator>
				<category><![CDATA[Articles Submits]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.isgoodstuff.com/2009/09/23/as3-fps-and-memory-counter-package/</guid>
		<description><![CDATA[One of my favorite class I used to include when developing games for flash is my FPS and Memory Counter Package. I use this to check my fps and memory consumption for my games. This helps to identify which of my methods I wrote is taxing the CPU or not. Simply import package to your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.isgoodstuff.com/wp-content/uploads/2009/09/ActionscriptIcon_400.png" rel="lightbox"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="ActionscriptIcon_400" border="0" alt="ActionscriptIcon_400" align="left" src="http://www.isgoodstuff.com/wp-content/uploads/2009/09/ActionscriptIcon_400_thumb.png" width="124" height="124" /></a> One of my favorite class I used to include when developing games for flash is my FPS and Memory Counter Package. I use this to check my fps and memory consumption for my games. </p>
<p>This helps to identify which of my methods I wrote is taxing the CPU or not. Simply import package to your main.as and add it into the stage </p>
<p>&nbsp;</p>
<p><span id="more-486"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// To use the class simply create a instance of it and add it to the stage.</span>
<span style="color: #808080; font-style: italic;">// var MyFPSMemCounter : FPSMemCounter  = new FPSMemCounter ();</span>
<span style="color: #808080; font-style: italic;">// addChild( fpsCounter );</span>
package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">Stage</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">system</span>.<span style="color: #0066CC;">System</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>. <span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">TextFieldAutoSize</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FPSMemCounter <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">TextField</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> fontSize : <span style="color: #0066CC;">Number</span>; <span style="color: #808080; font-style: italic;">//the font size for the field</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> lastUpdate : <span style="color: #0066CC;">Number</span>; <span style="color: #808080; font-style: italic;">// the results of getTimer() from the last update</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> frameCount : <span style="color: #0066CC;">Number</span>; <span style="color: #808080; font-style: italic;">//stores the count of frames passed this second</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> currentTime : <span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> const UPDATE_INTERVAL : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1000</span>; <span style="color: #808080; font-style: italic;">//the interval at which the frame count will be be posted</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> FPSMemCounter <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textColor</span> : <span style="color: #0066CC;">Number</span> = 0xFFFFFF, fontSize : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">25</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">textColor</span> = <span style="color: #0066CC;">textColor</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">fontSize</span> = <span style="color: #cc66cc;">12</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//set the field to autosize from the left</span>
			<span style="color: #0066CC;">autoSize</span> = TextFieldAutoSize.<span style="color: #0066CC;">LEFT</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//make the text unselecteable and disable mouse events</span>
			<span style="color: #0066CC;">selectable</span> = <span style="color: #000000; font-weight: bold;">false</span>;
			mouseEnabled = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
			addEventListener <span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, setFPSUpdate<span style="color: #66cc66;">&#41;</span>;
			addEventListener <span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">REMOVED_FROM_STAGE</span>, clearFPSUpdate<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">//called when the instance is added to a Display Object</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setFPSUpdate <span style="color: #66cc66;">&#40;</span>event : Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			addEventListener <span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, updateFPS<span style="color: #66cc66;">&#41;</span>;
			frameCount = <span style="color: #cc66cc;">0</span>;
			updateText <span style="color: #66cc66;">&#40;</span>frameCount<span style="color: #66cc66;">&#41;</span>;
			lastUpdate = <span style="color: #0066CC;">getTimer</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #808080; font-style: italic;">//called when the instance is removed from a Display Object</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clearFPSUpdate <span style="color: #66cc66;">&#40;</span>event : Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			removeEventListener <span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, updateFPS<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">//update the frame counter</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateFPS <span style="color: #66cc66;">&#40;</span>event : Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">//get the current time and increment the frame counter</span>
			currentTime = <span style="color: #0066CC;">getTimer</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			frameCount ++;
&nbsp;
			<span style="color: #808080; font-style: italic;">//post the frame count if more then a second has passed</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>currentTime <span style="color: #66cc66;">&gt;</span>= lastUpdate + UPDATE_INTERVAL<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				lastUpdate = currentTime;
				updateText <span style="color: #66cc66;">&#40;</span>frameCount<span style="color: #66cc66;">&#41;</span>;
				frameCount = <span style="color: #cc66cc;">0</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">//update the display text</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateText <span style="color: #66cc66;">&#40;</span>frameNum : <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> mem:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">System</span>.<span style="color: #006600;">totalMemory</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">1024</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">1024</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toFixed</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">'Mb'</span>;
			<span style="color: #0066CC;">htmlText</span> = <span style="color: #ff0000;">&quot;&lt;font size='&quot;</span> + fontSize + <span style="color: #ff0000;">&quot;'&gt;&lt;b&gt;FPS : &lt;/b&gt;&quot;</span> + frameNum + <span style="color: #ff0000;">&quot; fps&lt;/b&gt;&lt;b&gt; Memory : &lt;/b&gt;&quot;</span>+ mem +<span style="color: #ff0000;">&quot;&lt;/font&gt;&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<div style="text-align:left"><a style="text-align:left" href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/mrss.php?id=486'});">Start Slide Show with PicLens Lite <img src="http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.isgoodstuff.com/2009/09/26/as3-fps-and-memory-counter-package/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 : Gaia FrameWork Development Guide</title>
		<link>http://www.isgoodstuff.com/2009/08/17/as3-gaia-framework-development-guide/</link>
		<comments>http://www.isgoodstuff.com/2009/08/17/as3-gaia-framework-development-guide/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 01:05:00 +0000</pubDate>
		<dc:creator>Mr.GoodStuff</dc:creator>
				<category><![CDATA[Articles Submits]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.isgoodstuff.com/2009/08/18/as3-gaia-framework-development-guide/</guid>
		<description><![CDATA[Today, I’m gonna talk more in general about my experience in Gaia Framework. Here are some of the details I’ll cover in this post. The Index – using the index effectively. Assets Management – some example, on how to hook up an xml and graphical asset. The Index For me, index is best used for [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I’m gonna talk more in general about my experience in Gaia Framework. Here are some of the details I’ll cover in this post.</p>
<ul>
<li>The Index – using the index effectively.</li>
<li>Assets Management – some example, on how to hook up an xml and graphical asset.</li>
</ul>
<p><a href="http://www.isgoodstuff.com/wp-content/uploads/2009/08/Gaiapanel.jpg" rel="lightbox"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Gaiapanel" border="0" alt="Gaiapanel" src="http://www.isgoodstuff.com/wp-content/uploads/2009/08/Gaiapanel_thumb.jpg" width="294" height="416" /></a></p>
<p><span id="more-469"></span></p>
<p><strong>The Index</strong></p>
<p>For me, index is best used for :- </p>
<ol>
<li>Positioning a generic background for all your flash pages because, index appears the lowest depth. All you need to do is to just place the asset on stage. Be it image or just as color background. Just remember to remove Scalffold code inside the indexPage.as</li>
<li>Index is useful for global asset which you think, may be reused in all other pages. An example, will be a global xml for language. If you have decided to go multilingual site, placing your xml here is a good choice.</li>
<li>In order to access assets shared in Index, simply use the GAIA api method below :-</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//Where globalxml is my xml asset, text1 is the first child tag.</span>
<span style="color: #808080; font-style: italic;">//Picture1 is the picture asset which retrieves the src.</span>
<span style="color: #000000; font-weight: bold;">var</span> textData = Gaia.<span style="color: #006600;">api</span>.<span style="color: #006600;">getPage</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;index&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">assets</span>.<span style="color: #006600;">globalxml</span>.<span style="color: #0066CC;">xml</span>.<span style="color: #006600;">text1</span>;
<span style="color: #000000; font-weight: bold;">var</span> imageData = Gaia.<span style="color: #006600;">api</span>.<span style="color: #006600;">getPage</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;index&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">assets</span>.<span style="color: #006600;">picture1</span>;</pre></div></div>

<p><strong>Asset Management</strong></p>
<p>Asset Management is one of GAIA&#8217;s greatest strength in this framework. You can set your asset to preload with the page or use load on demand &#8211; based on the site.xml. See example code below, it shows how asset is set preload=false to use load on demand. Once, you have enable load on demand, you can either load yourself the asset using a loader class. Pass in the URLRequest which is the assets.picture1.src, addChild to a MovieClip Container once loaded and you are done.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Gaia Framework Site: %PAGE%&quot;</span> <span style="color: #000066;">menu</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">assetPath</span>=<span style="color: #ff0000;">&quot;assets/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;page</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;index&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;index.swf&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asset</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;globalxml&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;global.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;page</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;nav&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;nav.swf&quot;</span> <span style="color: #000066;">depth</span>=<span style="color: #ff0000;">&quot;top&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;page</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;home&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Home&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;home.swf&quot;</span> <span style="color: #000066;">menu</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asset</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;picture1&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;forest/forest.jpg&quot;</span> <span style="color: #000066;">preload</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/site<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<div style="text-align:left"><a style="text-align:left" href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/mrss.php?id=469'});">Start Slide Show with PicLens Lite <img src="http://www.isgoodstuff.com/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.isgoodstuff.com/2009/08/17/as3-gaia-framework-development-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
