<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Script.it</title>
	<atom:link href="http://blog.rackdoll.nl/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.rackdoll.nl</link>
	<description>.Stories of a Code Freak.</description>
	<pubDate>Wed, 04 Aug 2010 11:41:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
		<item>
		<title>[AS3.0] VideoScrubber NetStream upgrade.</title>
		<link>http://blog.rackdoll.nl/?p=953</link>
		<comments>http://blog.rackdoll.nl/?p=953#comments</comments>
		<pubDate>Wed, 04 Aug 2010 09:29:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Custom Classes]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=953</guid>
		<description><![CDATA[A while a go i posted the VideoScrubber class and the VideoScrubber Tutorial.
This class enables you to embed a video on the timeline and scrub thru the video.
You could drag and throw thru the frames. I have gotten alot of positive responses to the class.
A few days ago i got an email from Vladimir ( [...]]]></description>
			<content:encoded><![CDATA[<p>A while a go i posted the <a href="http://blog.rackdoll.nl/?p=536">VideoScrubber class</a> and the <a href="http://blog.rackdoll.nl/?p=614">VideoScrubber Tutorial</a>.<br />
This class enables you to embed a video on the timeline and scrub thru the video.<br />
You could drag and throw thru the frames. I have gotten alot of positive responses to the class.</p>
<p>A few days ago i got an email from Vladimir ( <a href="http://despark.com/">http://despark.com/</a> ).<br />
He kindly converted the <a href="http://lab.rackdoll.nl/flash/videoscrubber2/VideoScrubber.as">VideoScrubber.as</a> and added the <a href="http://lab.rackdoll.nl/flash/videoscrubber2/VideoAdapter.as">VideoAdapter Class</a>.<br />
Now the VideoScrubber doesn&#8217;t need a video embedded on the timeline.<br />
It can now load in an external FLV, and lets the user scrub thru it, just like <a href="http://blog.rackdoll.nl/?p=536">VideoScrubber v1</a>.<br />
Very cool!</p>
<p><strong>Here is an example of the <em>&#8216;new&#8217;</em> VideoScrubber with an external FLV:<br />
( –> grab, drag and throw! )</strong></p>
<p>
<object type="application/x-shockwave-flash" width="480" height="360">
<param name="movie" value="http://lab.rackdoll.nl/flash/videoscrubber2/VS.swf" />
<embed src="http://lab.rackdoll.nl/flash/videoscrubber2/VS.swf" type="application/x-shockwave-flash" width="480" height="360" >
</object>
</p>
<p><strong>Download:</strong><br />
- <a href="http://lab.rackdoll.nl/flash/videoscrubber2/src.zip">Source.zip</a><br />
- <a href="http://lab.rackdoll.nl/flash/videoscrubber2/video.flv">Demo FLV</a></p>
<p>thnx Vladimir.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=953</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] The Perlin Landscape</title>
		<link>http://blog.rackdoll.nl/?p=943</link>
		<comments>http://blog.rackdoll.nl/?p=943#comments</comments>
		<pubDate>Thu, 22 Jul 2010 10:47:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Framework]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[as3.0]]></category>

		<category><![CDATA[experimental]]></category>

		<category><![CDATA[perlinNoise]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=943</guid>
		<description><![CDATA[When working on &#8216;The Perlin Sea&#8217;, i realised there is more to be discovered on the use of perlinNoise.
So i went on the interwebs and started looking for cool stuff. I came along Neuro&#8217;s blog and found his Continuous PerlinNoise post.
I liked it. So&#8230;. i wanted to try it myself and see if i can [...]]]></description>
			<content:encoded><![CDATA[<p>When working on <a href="http://blog.rackdoll.nl/?p=738">&#8216;The Perlin Sea&#8217;</a>, i realised there is more to be discovered on the use of perlinNoise.<br />
So i went on the interwebs and started looking for cool stuff. I came along <a href="http://www.neuroproductions.be/">Neuro&#8217;s blog</a> and found <a href="http://www.neuroproductions.be/experiments/continuous-perlin-noise/">his Continuous PerlinNoise post</a>.<br />
I liked it. So&#8230;. i wanted to try it myself and see if i can do the same, maybe even slightly better ;).<br />
I am a big fan of opensource and sharing but not a fan of downloading source files before i have even tried to do it.<br />
 So i did try and i conquered! muhahaha!<br />
I even made it a screen in my little engine.</p>
<p><strong>The Perlin Landscape</strong> <em>(click the head to start)</em><br />

<object type="application/x-shockwave-flash" width="700" height="500">
<param name="movie" value="http://lab.rackdoll.nl/flash/landscaper/pixzorEngine.swf" />
<embed src="http://lab.rackdoll.nl/flash/landscaper/pixzorEngine.swf" type="application/x-shockwave-flash" width="700" height="500" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=943</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] The Perlin Sea</title>
		<link>http://blog.rackdoll.nl/?p=738</link>
		<comments>http://blog.rackdoll.nl/?p=738#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:55:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[as3.0]]></category>

		<category><![CDATA[experimental]]></category>

		<category><![CDATA[perlinNoise]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=738</guid>
		<description><![CDATA[Went thru some old stuff and found some of my old perlinNoise projects.
Loads of fun and a high coolness factor&#8230;..so i decided to do a screen for in  my engine.
Based on my old Perlin_Candy_Sea.
The Perlin Sea ( Press the head to start )






]]></description>
			<content:encoded><![CDATA[<p>Went thru some old stuff and found some of my old <a href="http://en.wikipedia.org/wiki/Perlin_noise">perlinNoise</a> projects.<br />
Loads of fun and a high coolness factor&#8230;..so i decided to do a screen for in  my engine.<br />
Based on my old <a href="http://blog.rackdoll.nl/?p=528">Perlin_Candy_Sea</a>.</p>
<p><strong>The Perlin Sea</strong> <em>( Press the head to start )</em><br />

<object type="application/x-shockwave-flash" width="700" height="500">
<param name="movie" value="http://blog.rackdoll.nl/wp-content/uploads/2010/07/thePerlinSea.swf" />
<embed src="http://blog.rackdoll.nl/wp-content/uploads/2010/07/thePerlinSea.swf" type="application/x-shockwave-flash" width="700" height="500" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=738</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] Lorenz Curve</title>
		<link>http://blog.rackdoll.nl/?p=721</link>
		<comments>http://blog.rackdoll.nl/?p=721#comments</comments>
		<pubDate>Wed, 14 Jul 2010 11:27:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[Trigonometry]]></category>

		<category><![CDATA[as3.0]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=721</guid>
		<description><![CDATA[The Lorenz Curve.
An equation i wanted to do for a long time.I knew i had to try one.
Discovered by Edward Norton Lorenz, this shape is a mathmatical wonder.
it looks like:

Here is the code which makes it all run:

[-]View CodeACTIONSCRIPT1
2
3
4
5
6
7
8
9
10
11
12
13
14
//lorenz constants
var step:Number = 0.005;
var sigma:Number = 10.0;
var rho:Number = 28.0;
var beta:Number = 8.0 / 3.0;
&#160;
//lorenz equation:
x1=x0+step*sigma*&#40;y0-x0&#41;;
y1=y0+step*&#40;x0*&#40;rho-z0&#41;-y0&#41;;
z1=z0+step*&#40;x0*y0-beta*z0&#41;;
&#160;
x0=x1;
y0=y1;
z0=z1;

And [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Lorenz_attractor">The Lorenz Curve.</a><br />
An equation i wanted to do for a long time.I knew i had to try one.<br />
Discovered by <a href="http://en.wikipedia.org/wiki/Edward_Norton_Lorenz">Edward Norton Lorenz</a>, this shape is a mathmatical wonder.</p>
<p>it looks like:</p>
<pre><img src="http://upload.wikimedia.org/wikipedia/commons/2/25/LorenzAttractor.png" alt="Lorenz Curve" ></img></pre>
<p>Here is the code which makes it all run:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="right"><a class="smalltxt" href="###" onclick="toggle_collapse('7212');">[<span id="7212_symbol">-</span>]</a></div><div class="left"><span id="l721code2"><a href="#" onclick="javascript:showCodeTxt('721code2'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="7212"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="721code2"><pre class="actionscript"><span style="color: #808080; font-style: italic;">//lorenz constants</span>
<span style="color: #000000; font-weight: bold;">var</span> step:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0.005</span>;
<span style="color: #000000; font-weight: bold;">var</span> sigma:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">10.0</span>;
<span style="color: #000000; font-weight: bold;">var</span> rho:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">28.0</span>;
<span style="color: #000000; font-weight: bold;">var</span> beta:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">8.0</span> / <span style="color: #cc66cc;">3.0</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//lorenz equation:</span>
x1=x0+step*sigma*<span style="color: #66cc66;">&#40;</span>y0-x0<span style="color: #66cc66;">&#41;</span>;
y1=y0+step*<span style="color: #66cc66;">&#40;</span>x0*<span style="color: #66cc66;">&#40;</span>rho-z0<span style="color: #66cc66;">&#41;</span>-y0<span style="color: #66cc66;">&#41;</span>;
z1=z0+step*<span style="color: #66cc66;">&#40;</span>x0*y0-beta*z0<span style="color: #66cc66;">&#41;</span>;
&nbsp;
x0=x1;
y0=y1;
z0=z1;</pre></td></tr></table></div>

<p>And here is the result in my demo engine:<br />

<object type="application/x-shockwave-flash" width="600" height="400">
<param name="movie" value="http://blog.rackdoll.nl/wp-content/uploads/2010/07/pixzorengine1.swf" />
<embed src="http://blog.rackdoll.nl/wp-content/uploads/2010/07/pixzorengine1.swf" type="application/x-shockwave-flash" width="600" height="400" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=721</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] ParticleStorm Lissajous</title>
		<link>http://blog.rackdoll.nl/?p=713</link>
		<comments>http://blog.rackdoll.nl/?p=713#comments</comments>
		<pubDate>Fri, 18 Jun 2010 23:53:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[as3.0]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=713</guid>
		<description><![CDATA[When i saw Ralph Hauwert&#8217;s Bloom particle flow i knew i needed to know how and what.
So, as a homage to Ralph, here it is with a lissajous curve as position for the emitter.






]]></description>
			<content:encoded><![CDATA[<p>When i saw <a href="http://www.letitbloom.com/#ralph">Ralph Hauwert&#8217;s Bloom</a> particle flow i knew i needed to know how and what.<br />
So, as a homage to <a href="http://www.unitzeroone.com/blog/">Ralph</a>, here it is with a lissajous curve as position for the emitter.</p>
<p>
<object type="application/x-shockwave-flash" width="950" height="500">
<param name="movie" value="http://blog.rackdoll.nl/wp-content/uploads/2010/06/pixzorengine1.swf" />
<embed src="http://blog.rackdoll.nl/wp-content/uploads/2010/06/pixzorengine1.swf" type="application/x-shockwave-flash" width="950" height="500" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=713</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] Distancefield particle fun!</title>
		<link>http://blog.rackdoll.nl/?p=697</link>
		<comments>http://blog.rackdoll.nl/?p=697#comments</comments>
		<pubDate>Thu, 17 Jun 2010 18:58:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[Trigonometry]]></category>

		<category><![CDATA[as3.0]]></category>

		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=697</guid>
		<description><![CDATA[Distancefield&#8230;  just playing around with particles &#8216;n code srtuctures&#8230;
having some fun. looks nice&#8230;. could add some more filter stuff maybe..
but for now this will do .
ow ye.. mouse is now a point controlled by a lissajous curve in 2d space

[-]View CodeACTIONSCRIPT1
2
mouseDistance = Math.sqrt&#40; xdiff * xdiff + ydiff * ydiff&#41;;
current.scaleX = current.scaleY =  [...]]]></description>
			<content:encoded><![CDATA[<p>Distancefield&#8230;  just playing around with particles &#8216;n code srtuctures&#8230;<br />
having some fun. looks nice&#8230;. could add some more filter stuff maybe..<br />
but for now this will do .</p>
<p>ow ye.. mouse is now a point controlled by a lissajous curve in 2d space</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="right"><a class="smalltxt" href="###" onclick="toggle_collapse('6974');">[<span id="6974_symbol">-</span>]</a></div><div class="left"><span id="l697code4"><a href="#" onclick="javascript:showCodeTxt('697code4'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="6974"><td width="1%" class="line_numbers"><pre>1
2
</pre></td><td class="code" id="697code4"><pre class="actionscript">mouseDistance = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sqrt</span><span style="color: #66cc66;">&#40;</span> xdiff * xdiff + ydiff * ydiff<span style="color: #66cc66;">&#41;</span>;
current.<span style="color: #006600;">scaleX</span> = current.<span style="color: #006600;">scaleY</span> =  <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">4.0</span>, <span style="color: #66cc66;">&#40;</span>  mouseDistance / <span style="color: #cc66cc;">700</span><span style="color: #66cc66;">&#41;</span> * <span style="color: #cc66cc;">4.0</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>..and stuff&#8230;</p>
<p>
<object type="application/x-shockwave-flash" width="950" height="500">
<param name="movie" value="http://blog.rackdoll.nl/wp-content/uploads/2010/06/pixzorengine.swf" />
<embed src="http://blog.rackdoll.nl/wp-content/uploads/2010/06/pixzorengine.swf" type="application/x-shockwave-flash" width="950" height="500" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=697</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] Lissajous Curve 3D</title>
		<link>http://blog.rackdoll.nl/?p=680</link>
		<comments>http://blog.rackdoll.nl/?p=680#comments</comments>
		<pubDate>Thu, 08 Apr 2010 23:35:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[3D]]></category>

		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Custom Classes]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[as3.0]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=680</guid>
		<description><![CDATA[Stumbled upon this funny little curve. I have seen it show its face in many old experiments,
but i never knew the curve is  called a Lissajous curve.
a normal Lissajous curve:


Played around with it. Added an equation for the Z-Axis. I liked the result so i plugged it in my little lab engine.
something like:
There are [...]]]></description>
			<content:encoded><![CDATA[<p>Stumbled upon this funny little curve. I have seen it show its face in many old experiments,<br />
but i never knew the curve is  called a <a href="http://en.wikipedia.org/wiki/Lissajous_curve" target="_blank">Lissajous curve</a>.</p>
<p>a <strong>normal</strong> Lissajous curve:</p>
<pre><img src="http://upload.wikimedia.org/wikipedia/en/0/0c/Lissajous_animate.gif" alt="LissajousCurve" width="300px" height="300px"/></pre>
<p>
Played around with it. Added an equation for the Z-Axis. I liked the result so i plugged it in my little lab engine.</p>
<p>something like:<br />
There are 3 particles.<br />
All have a  random <a href="http://en.wikipedia.org/wiki/Lissajous_curve" target="_blank">Lissajous</a> behaviour for x, y and z.<br />
The fader modifier takes care of the tales.</p>
<p><strong>Lissajous3D:</strong></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="right"><a class="smalltxt" href="###" onclick="toggle_collapse('6806');">[<span id="6806_symbol">-</span>]</a></div><div class="left"><span id="l680code6"><a href="#" onclick="javascript:showCodeTxt('680code6'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="6806"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="680code6"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> t:<span style="color: #0066CC;">Number</span> = N;
<span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">9</span>;
<span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">8</span>;
<span style="color: #000000; font-weight: bold;">var</span> S:<span style="color: #0066CC;">Number</span> = t * <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> / <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> x:<span style="color: #0066CC;">Number</span> = xx * <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span> a * t + S <span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> y:<span style="color: #0066CC;">Number</span> = yy * <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>b * t<span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> z:<span style="color: #0066CC;">Number</span> = zz * <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>a/b<span style="color: #66cc66;">&#41;</span>*S<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Here&#8217;s the result.<br />

<object type="application/x-shockwave-flash" width="600" height="600">
<param name="movie" value="http://blog.rackdoll.nl/wp-content/uploads/2010/04/particles.swf" />
<embed src="http://blog.rackdoll.nl/wp-content/uploads/2010/04/particles.swf" type="application/x-shockwave-flash" width="600" height="600" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=680</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[Lab] MetaBalls</title>
		<link>http://blog.rackdoll.nl/?p=672</link>
		<comments>http://blog.rackdoll.nl/?p=672#comments</comments>
		<pubDate>Mon, 15 Mar 2010 09:21:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Custom Classes]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Framework]]></category>

		<category><![CDATA[Lab]]></category>

		<category><![CDATA[projects]]></category>

		<category><![CDATA[as3.0]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=672</guid>
		<description><![CDATA[An effect i wanted to do for a long time!
This effect is made with the same framework as the pixel primitives.
Hoping to expand it more and more till i have a nice little demo framework..






have fun!
Rackdoll.
]]></description>
			<content:encoded><![CDATA[<p>An effect i wanted to do for a long time!<br />
This effect is made with the same framework as the <a href="http://blog.rackdoll.nl/?p=654" target="_blank">pixel primitives</a>.<br />
Hoping to expand it more and more till i have a nice little demo framework..</p>
<p>
<object type="application/x-shockwave-flash" width="950" height="400">
<param name="movie" value="http://blog.rackdoll.nl/wp-content/uploads/2010/03/particles.swf" />
<embed src="http://blog.rackdoll.nl/wp-content/uploads/2010/03/particles.swf" type="application/x-shockwave-flash" width="950" height="400" >
</object>
</p>
<p>have fun!<br />
Rackdoll.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=672</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
		<item>
		<title>[as3.0] SoundManager v1.0</title>
		<link>http://blog.rackdoll.nl/?p=664</link>
		<comments>http://blog.rackdoll.nl/?p=664#comments</comments>
		<pubDate>Wed, 24 Feb 2010 11:39:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[AS3.0]]></category>

		<category><![CDATA[Custom Classes]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[as3.0]]></category>

		<guid isPermaLink="false">http://blog.rackdoll.nl/?p=664</guid>
		<description><![CDATA[Needed to work with sounds in a project. So i decided to make a dynamic SoundManager class to handle it all. Now i can easily load and handle the sounds i use inside a flash project. Currently this manager only plays the .mp3 format, but am looking into playing other formats aswell.
Download it at googlecode.
Maybe [...]]]></description>
			<content:encoded><![CDATA[<p>Needed to work with sounds in a project. So i decided to make a dynamic SoundManager class to handle it all. Now i can easily load and handle the sounds i use inside a flash project. Currently this manager only plays the <em>.mp3</em> format, but am looking into playing other formats aswell.</p>
<p>Download it at <a href="http://code.google.com/p/rackdoll/downloads/list" target="_blank">googlecode</a>.<br />
Maybe take a look on the <a href="http://code.google.com/p/rackdoll/wiki/SoundManager" target="_blank">wiki about it</a>.</p>
<p>Or</p>
<p>Take a look at the class code:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="right"><a class="smalltxt" href="###" onclick="toggle_collapse('6648');">[<span id="6648_symbol">-</span>]</a></div><div class="left"><span id="l664code8"><a href="#" onclick="javascript:showCodeTxt('664code8'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="6648"><td width="1%" 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
</pre></td><td class="code" id="664code8"><pre class="actionscript">package 
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #006600;">SoundTransform</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">IOErrorEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">ProgressEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Dictionary</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #0066CC;">Sound</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #006600;">SoundChannel</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * @author  RACKDOLL
	 * @version 1.0
	 * @usage
	 * SoundManager.getInstance().addSound  ( &quot;yourSoundID&quot;, &quot;yourSoundPath&quot; );
	 * SoundManager.getIinstance().playSound( &quot;yourSoundID&quot;, yourVolume, yourRepeatCount );
	 * SoundManager.getInstance().stopSound ( &quot;yourSoundID&quot; );
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SoundManager
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> sounds           :Dictionary   = <span style="color: #000000; font-weight: bold;">null</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> currPlayingSounds:Dictionary   = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
<span style="color: #808080; font-style: italic;">// 					C O N S T R U C T O R</span>
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> SoundManager<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			sounds 			  = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			currPlayingSounds = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// --&gt; SINGLETON:</span>
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> _instance:SoundManager;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> getInstance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:SoundManager 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>!_instance <span style="color: #66cc66;">&#41;</span>_instance = <span style="color: #000000; font-weight: bold;">new</span> SoundManager<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> _instance;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
<span style="color: #808080; font-style: italic;">// 					A D D  /  R E M O V E</span>
<span style="color: #808080; font-style: italic;">//***************************************************************************		</span>
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">//  ADD SOUND WITH ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addSound<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span>, $url:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			sounds<span style="color: #66cc66;">&#91;</span>$id<span style="color: #66cc66;">&#93;</span> = $url;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">//  REMOVE SOUND WITH ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> removeSound<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</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> id:<span style="color: #0066CC;">String</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//1.</span>
			<span style="color: #808080; font-style: italic;">//check current playing sounds dictionary for sound:</span>
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> id <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">delete</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>;
					<span style="color: #b1b100;">break</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
			<span style="color: #808080; font-style: italic;">//2.</span>
			<span style="color: #808080; font-style: italic;">//check all sounds dictionary for sound:</span>
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> id <span style="color: #b1b100;">in</span> sounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">delete</span> sounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>;
					<span style="color: #b1b100;">break</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
<span style="color: #808080; font-style: italic;">// 					P L A Y  /  S T O P</span>
<span style="color: #808080; font-style: italic;">//***************************************************************************		</span>
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">//  PLAY SOUND WITH ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> playSound<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span>, $volume:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1.0</span>, $timesToRepeat:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">999</span> <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;">//first check if it alrdy excists, if so...start it!</span>
			<span style="color: #000000; font-weight: bold;">var</span> t:SoundTransform;
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> c:SoundChannel  = currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> as SoundChannel;
					<span style="color: #000000; font-weight: bold;">var</span> s:<span style="color: #0066CC;">Sound</span>         = currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">sound</span> as <span style="color: #0066CC;">Sound</span>;
					t = <span style="color: #000000; font-weight: bold;">new</span> SoundTransform<span style="color: #66cc66;">&#40;</span>$volume<span style="color: #66cc66;">&#41;</span>;
					c = s.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, $timesToRepeat<span style="color: #66cc66;">&#41;</span>;
					c.<span style="color: #006600;">soundTransform</span> = t;
					currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#123;</span> channel: c, <span style="color: #0066CC;">sound</span>: s, volume: $volume <span style="color: #66cc66;">&#125;</span>;
					<span style="color: #b1b100;">return</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
			<span style="color: #808080; font-style: italic;">//---</span>
			<span style="color: #808080; font-style: italic;">//If we come here, it means we have a new sound!</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">//setup sound:</span>
			<span style="color: #000000; font-weight: bold;">var</span> req:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span> sounds<span style="color: #66cc66;">&#91;</span>$id<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> soundFactory:<span style="color: #0066CC;">Sound</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Sound</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			soundFactory.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>	    , onSoundFactoryComplete <span style="color: #66cc66;">&#41;</span>;
			soundFactory.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, onSoundFactoryProgress <span style="color: #66cc66;">&#41;</span>;
			soundFactory.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>IOErrorEvent.<span style="color: #006600;">IO_ERROR</span> , onIOError <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//load sound:</span>
			soundFactory.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span> req <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//play sound:</span>
			<span style="color: #000000; font-weight: bold;">var</span> channel:SoundChannel = <span style="color: #000000; font-weight: bold;">new</span> SoundChannel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			channel = soundFactory.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, $timesToRepeat<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//set volume:</span>
			t = <span style="color: #000000; font-weight: bold;">new</span> SoundTransform<span style="color: #66cc66;">&#40;</span>$volume<span style="color: #66cc66;">&#41;</span>;
			channel.<span style="color: #006600;">soundTransform</span> = t;
&nbsp;
&nbsp;
			<span style="color: #808080; font-style: italic;">//save soound in current playing sounds:</span>
			currPlayingSounds<span style="color: #66cc66;">&#91;</span> $id <span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#123;</span> channel: channel, <span style="color: #0066CC;">sound</span>: soundFactory, volume: $volume  <span style="color: #66cc66;">&#125;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">//STOP SOUND WITH ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> stopSound<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> id <span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					SoundChannel<span style="color: #66cc66;">&#40;</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
<span style="color: #808080; font-style: italic;">// 					V O L U M E</span>
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">// SET ALL SOUND VOLUMES:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setGlobalVolume<span style="color: #66cc66;">&#40;</span> $volume:<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: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> s:SoundTransform = <span style="color: #000000; font-weight: bold;">new</span> SoundTransform<span style="color: #66cc66;">&#40;</span>$volume<span style="color: #66cc66;">&#41;</span>;
					SoundChannel<span style="color: #66cc66;">&#40;</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">soundTransform</span> = s;
					currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">volume</span> = $volume;
				<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">// TOGGLE MUTE ALL SOUNDS:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> muteAll<span style="color: #66cc66;">&#40;</span> $mute:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> $mute <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				setGlobalVolume<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">else</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> s:SoundTransform = <span style="color: #000000; font-weight: bold;">new</span> SoundTransform<span style="color: #66cc66;">&#40;</span>currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">volume</span><span style="color: #66cc66;">&#41;</span>;
					SoundChannel<span style="color: #66cc66;">&#40;</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">soundTransform</span> = s;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">// SET SOUND VOLUME BY SOUND ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">setVolume</span><span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span>, $volume:<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: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> s:SoundTransform = <span style="color: #000000; font-weight: bold;">new</span> SoundTransform<span style="color: #66cc66;">&#40;</span>$volume<span style="color: #66cc66;">&#41;</span>;
					SoundChannel<span style="color: #66cc66;">&#40;</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">soundTransform</span> = s;
					currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">volume</span> = $volume;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
<span style="color: #808080; font-style: italic;">// 			 R E A D I N G _ P R O P E R T I E S</span>
<span style="color: #808080; font-style: italic;">//***************************************************************************		</span>
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">// GET SOUND CHANNEL BY SOUND ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getSoundChannel<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:SoundChannel 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">return</span> SoundChannel<span style="color: #66cc66;">&#40;</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> <span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			throwError<span style="color: #66cc66;">&#40;</span>ERROR_NON_EXCISTENT_CHANNEL<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">// GET SOUND TRANSFORM BY SOUND ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getSoundTransform<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:SoundTransform 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">return</span> SoundChannel<span style="color: #66cc66;">&#40;</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">channel</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">soundTransform</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			throwError<span style="color: #66cc66;">&#40;</span>ERROR_NON_EXCISTENT_TRANSFORM<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #808080; font-style: italic;">// GET SOUND VOLUME BY SOUND ID:</span>
		<span style="color: #808080; font-style: italic;">//-------------------------------</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getSoundVolume<span style="color: #66cc66;">&#40;</span> $id:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> currPlayingSounds<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> id == $id <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">return</span> currPlayingSounds<span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">volume</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			throwError<span style="color: #66cc66;">&#40;</span>ERROR_NON_EXCISTENT_VOLUME<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">NaN</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
<span style="color: #808080; font-style: italic;">// 					H A N D L E R S</span>
<span style="color: #808080; font-style: italic;">//***************************************************************************</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const ERROR_NON_EXCISTENT_CHANNEL   :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;You are trying to get a non excistent soundChannel!<span style="color: #000099; font-weight: bold;">\n</span>Play it first in order to assign a channel!&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const ERROR_NON_EXCISTENT_VOLUME    :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;You are trying to get a non excistent volume!<span style="color: #000099; font-weight: bold;">\n</span>Play it first in order to assign a volume!&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const ERROR_NON_EXCISTENT_TRANSFORM :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;You are trying to get a non excistent soundTransform!<span style="color: #000099; font-weight: bold;">\n</span>Play it first in order to assign a transform!&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const ERROR_IO					  :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;There is an I-O error!&quot;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> throwError<span style="color: #66cc66;">&#40;</span> $error:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;undefined_error&quot;</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">throw</span> <span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*** --&gt; SOUND WARNING: &quot;</span>+$error+<span style="color: #ff0000;">&quot;&lt;-- ***&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onSoundFactoryComplete<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;sound complete!&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onSoundFactoryProgress<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event = <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;sounnd progress!&quot;</span><span style="color: #66cc66;">&#41;</span>;	
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onIOError<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event = <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			throwError<span style="color: #66cc66;">&#40;</span> ERROR_IO <span style="color: #66cc66;">&#41;</span>;	
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>have fun!<br />
Rackdoll</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rackdoll.nl/?feed=rss2&amp;p=664</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</creativeCommons:license>
	</item>
	</channel>
</rss>
