<?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>Mental Notes &#187; Flash</title>
	<atom:link href="http://stephan.acidcats.nl/blog/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://stephan.acidcats.nl/blog</link>
	<description>from the trenches of software development</description>
	<lastBuildDate>Sun, 01 Mar 2009 19:44:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spectral Analysis source files</title>
		<link>http://stephan.acidcats.nl/blog/2009/03/01/spectral-analysis-source-files/</link>
		<comments>http://stephan.acidcats.nl/blog/2009/03/01/spectral-analysis-source-files/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 19:39:33 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/?p=39</guid>
		<description><![CDATA[Here&#8217;s the first draft of my source files for Fourier Transform. Currently the swf expects a sound file named &#8220;test.mp3&#8243; in the same folder, but you can easily change that. It&#8217;s drawing the spectral analysis of the first couple of seconds of sound of that mp3 file. 
I have code lying around to load a file instead, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the first draft of my <a title="FFT source files" href="http://stephan.acidcats.nl/blog/wp-content/fft_src.zip">source files</a> for Fourier Transform. Currently the swf expects a sound file named &#8220;test.mp3&#8243; in the same folder, but you can easily change that. It&#8217;s drawing the spectral analysis of the first couple of seconds of sound of that mp3 file. </p>
<p>I have code lying around to load a file instead, and I&#8217;ll see if I can make some time to implement that so I can put up a working example, with paging etc.</p>
<p>Take note that the FFT.as class, which contains the hard core code for the Fourier Transform, is a port from C++, and is copyrighted by the original writer of that code. Please leave in his copyright note when using this code.</p>
<p>I heard that Andre Michelle uses linked lists instead of Vector to speed things up. I didn&#8217;t make it to his talk on FitC Amsterdam, unfortunately, so I don&#8217;t know the details about that yet, but that might give an extra speed boost here and there. Maybe the butterfly algorithm that FFT uses, can be implemented in this way&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2009/03/01/spectral-analysis-source-files/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>AIR applications snoop CPU time on Mac</title>
		<link>http://stephan.acidcats.nl/blog/2009/02/19/air-applications-snoop-cpu-time-on-mac/</link>
		<comments>http://stephan.acidcats.nl/blog/2009/02/19/air-applications-snoop-cpu-time-on-mac/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 10:03:46 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/?p=36</guid>
		<description><![CDATA[One of the features of the Yala logging viewer is its low CPU load. I began to notice while looking at the Activity Monitor on my Mac that Yala was quite constant at roughly 3.5% CPU load. I also saw that the twitter client I just started using, DestroyTwitter, had an average load of around [...]]]></description>
			<content:encoded><![CDATA[<p>One of the features of the <a title="Yalog" href="http://code.google.com/p/yalog/" target="_blank">Yala logging viewer</a> is its low CPU load. I began to notice while looking at the Activity Monitor on my Mac that Yala was quite constant at roughly 3.5% CPU load. I also saw that the twitter client I just started using, <a title="DestroyTwitter" href="http://www.destroytoday.com/projects/destroytwitter" target="_blank">DestroyTwitter</a>, had an average load of around 7%, sometimes staying around 18% for minutes. That&#8217;s a lot of CPU power (and hence power draw &amp; battery load). I began to wonder if a basic empty AIR application would show the same behaviour. And guess what? An empty AIR application draws 3% CPU load on a MacBookPro 3rd gen. For doing nothing, I find that quite rediculous.<br />
The profiler doesn&#8217;t make me much wiser. It seems to spend quite some time doing [reap]. Did someone implement a grim reaper? Is the application desperately trying not to die? Maybe time for looking up the bug base for AIR.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2009/02/19/air-applications-snoop-cpu-time-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Progress events fired double?!</title>
		<link>http://stephan.acidcats.nl/blog/2009/02/11/progress-events-fired-double/</link>
		<comments>http://stephan.acidcats.nl/blog/2009/02/11/progress-events-fired-double/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 11:15:08 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/?p=34</guid>
		<description><![CDATA[ 
Notice something strange in the log output in the image? Each line is a ProgressEvent as received from a Loader. Check the bytes loaded&#8230; Why do we get the event a second time for the old number of loaded bytes by  the time the new number of bytes has been received? Is that a [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<div id="attachment_33" class="wp-caption alignleft" style="width: 473px"><img class="size-full wp-image-33" title=" " src="http://stephan.acidcats.nl/blog/wp-content/picture-1.png" alt="Yalog output for loading an image" width="463" height="166" /><p class="wp-caption-text">Yalog output for loading an image</p></div>
<p>Notice something strange in the log output in the image? Each line is a ProgressEvent as received from a Loader. Check the bytes loaded&#8230; Why do we get the event a second time for the old number of loaded bytes by  the time the new number of bytes has been received? Is that a bug or a feature?</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2009/02/11/progress-events-fired-double/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yalog (Actionscript 3 log utility with viewer) open source</title>
		<link>http://stephan.acidcats.nl/blog/2009/02/04/yalog-actionscript-3-log-utility-with-viewer-open-source/</link>
		<comments>http://stephan.acidcats.nl/blog/2009/02/04/yalog-actionscript-3-log-utility-with-viewer-open-source/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 12:05:27 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Yalog]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/?p=27</guid>
		<description><![CDATA[A few years ago I developed a logging class plus viewer application for debugging purposes. Main requirement was lightweightedness: the logging code should put as little pressure on the CPU as possible, and so should the viewer. At LBi Lost Boys, the company I&#8217;m working for, we&#8217;ve been using this utility over the last years, [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago I developed a logging class plus viewer application for debugging purposes. Main requirement was lightweightedness: the logging code should put as little pressure on the CPU as possible, and so should the viewer. At LBi Lost Boys, the company I&#8217;m working for, we&#8217;ve been using this utility over the last years, and it&#8217;s become an indispensible component of our work flow.<br />
Last week I put out the source, both of the log utility and of the viewer, into open source space. Check <a title="Yalog on Google Code" href="http://code.google.com/p/yalog/" target="_self">the main page on Google Code </a>for source code and downloads. </p>
<p> </p>
<div id="attachment_28" class="wp-caption alignleft" style="width: 138px"><img class="size-full wp-image-28" title="Yala - Yalog viewer" src="http://stephan.acidcats.nl/blog/wp-content/yala128.png" alt="Icon of Yala, the Yalog viewer AIR application" width="128" height="128" /><p class="wp-caption-text"> </p></div>
<p> Yalog consists of the logging utility, comprising one main class (Yalog.as) and a few helper classes, and a viewer. This viewer is basically a swf, so can be used in any context where a swf can be used. Currently it&#8217;s <a title="Yalog viewer application installer" href="http://yalog.googlecode.com/files/Yala_installer_301.air" target="_blank">available for download</a> as an AIR-application. If you just want to use this and not be bothered with the source of the viewer, <a title="Yalog sources" href="http://yalog.googlecode.com/files/Yalog_src_301.zip" target="_blank">download</a> the Yalog source classes, and install the AIR application. </p>
<p> </p>
<p>The viewer can be seen in action at <a title="Yala viewer in HTML" href="http://yala.acidcats.nl/" target="_blank">http://yala.acidcats.nl/</a>. If you open a Yalog-enabled site (such as <a title="DE.nl" href="http://www.de.nl" target="_blank">www.de.nl</a>), you will see debug messages appear in the viewer. A nifty feature of Yalog is that it buffers the last 200 messages (number can be changed) until the viewer appears, so you can open the viewer after something has gone wrong, and still view the latest messages.</p>
<p>When I have more time, I&#8217;ll put up a page here with more info and details.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2009/02/04/yalog-actionscript-3-log-utility-with-viewer-open-source/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Spectral analysis with Fast Fourier Transform in Actionscript</title>
		<link>http://stephan.acidcats.nl/blog/2008/12/04/spectral-analysis-with-fast-fourier-transform-in-actionscript/</link>
		<comments>http://stephan.acidcats.nl/blog/2008/12/04/spectral-analysis-with-fast-fourier-transform-in-actionscript/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 13:01:34 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[FFT]]></category>
		<category><![CDATA[spectral analysis]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/?p=23</guid>
		<description><![CDATA[The presentation by Adobe&#8217;s Jim Corbett on Alchemy at the Adobe MAX 2008 conference in Milan last Tuesday (2nd of December), got me thinking about something I used to spend quite some time on back in the early 90&#8217;s, when I studied Sonology at the Kon. Conservatorium in Den Haag: spectral analysis &#38; (re)synthesis of sound. [...]]]></description>
			<content:encoded><![CDATA[<p>The presentation by Adobe&#8217;s Jim Corbett on <a title="Alchemy C/C++ to Actionscript" href="http://labs.adobe.com/technologies/alchemy/" target="_blank">Alchemy</a> at the Adobe MAX 2008 conference in Milan last Tuesday (2nd of December), got me thinking about something I used to spend quite some time on back in the early 90&#8217;s, when I studied Sonology at the Kon. Conservatorium in Den Haag: spectral analysis &amp; (re)synthesis of sound. This is usually done by means of the <a title="Fourier Transform on Wikipedia" href="http://en.wikipedia.org/wiki/Fourier_transform" target="_blank">Fourier Transform</a>, which transforms time-based data such as sound to the frequency domain. The most used algorithm for this is the Fast Fourier Transform, or FFT, which requires the number of samples per transformation to be a power of 2. Usually a block of 1024 samples is used, which equals roughly 50ms of sound at 44.1kHz.</p>
<p>Now the FFT algorithm is quite CPU-intensive, and as Alchemy is put forward as useful for large number-crunching operations, I thought this could be a very interesting case. In order to allow for proper comparison, I decided to first port the FFT code from C to Actionscript, and do some testing. It took some refactoring of the C-code in Actionscript to allow for specific bottlenecks popping up, such as multiple lookup of the same value from a Vector, which turns out to be an expensive operation. Also the calculation of sine &amp; cosine was done beforehand, to allow for a lookup table to be used in the actual FFT algorithm. All in all I managed to gain some 50% speed increase by these optimizations.</p>
<p>To my surprise, a single transformation of one block of 1024 samples takes only 5 ms in Actionscript. Even when performing the necessary after-calculations (normalizing &amp; getting the lenght of vectors, which requires Math.sqrt), a back-and-forth transformation shouldn&#8217;t take more than 10 ms, leaving 40ms for doing fun stuff with the data. So even without a C-port it&#8217;s possible to do real time audio transformation in the frequency domain.</p>
<p>The first thing to do is plot the data in an image. Right now I&#8217;m only posting a screenshot, as I&#8217;d like to polish the example a bit more before putting out the actual code, but this is what a frequency plot of a short piece of music looks like:</p>
<p><a href="http://stephan.acidcats.nl/blog/wp-content/picture-1.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-24" title="Spectral analysis" src="http://stephan.acidcats.nl/blog/wp-content/picture-1-300x154.jpg" alt="" width="300" height="154" /></a></p>
<p>More about this (including source code) soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2008/12/04/spectral-analysis-with-fast-fourier-transform-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Flocking</title>
		<link>http://stephan.acidcats.nl/blog/2007/12/26/19/</link>
		<comments>http://stephan.acidcats.nl/blog/2007/12/26/19/#comments</comments>
		<pubDate>Wed, 26 Dec 2007 22:28:32 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[experiments]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/2007/12/26/19/</guid>
		<description><![CDATA[I&#8217;m experimenting a bit with flocking. Haven&#8217;t gotten as far a moving stuff in any interesting way yet, but it&#8217;s fun enough to fool around with maths I haven&#8217;t looked at for decades. In the sample below you can see how the vectors of attraction pull the birds (yeah right!) to the common center, while [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m experimenting a bit with <a href="http://en.wikipedia.org/wiki/Flocking_(behavior)" title="Flocking on WikiPedia" target="_blank">flocking</a>. Haven&#8217;t gotten as far a moving stuff in any interesting way yet, but it&#8217;s fun enough to fool around with maths I haven&#8217;t looked at for decades. In the sample below you can see how the vectors of attraction pull the birds (yeah right!) to the common center, while birdies that are close to each other get nasty long green repulsion vectors.</p>
<p>Click to make them start moving to the center, click again to stop the motion. Makes for a nice hedgehog at some point <img src='http://stephan.acidcats.nl/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>The source code is <a href="http://stephan.acidcats.nl/blog/wp-content/flocking_source.zip" title="Source code for flocking experiment">here</a>. No fla file, code only.</p>
<p>And thanks to <a href="http://www.bonth.nl/" target="_blank" title="Arie de Bonth">Arie</a> for his <a href="http://www.bonth.nl/eerste-pagina/" target="_blank" title="Post on Kimili">tip</a> about the <a href="http://kimili.com/plugins/kimili-flash-embed-for-wordpress" title="Kimili Flash plugin for WordPress" target="_blank">Kimili Wordpress Flash plugin</a></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_flocking_673850424"
			class="flashmovie"
			width="440"
			height="440">
	<param name="movie" value="http://stephan.acidcats.nl/blog/wp-content/flocking.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://stephan.acidcats.nl/blog/wp-content/flocking.swf"
			name="fm_flocking_673850424"
			width="440"
			height="440">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2007/12/26/19/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ADDED_TO_STAGE</title>
		<link>http://stephan.acidcats.nl/blog/2007/12/25/added_to_stage/</link>
		<comments>http://stephan.acidcats.nl/blog/2007/12/25/added_to_stage/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 22:42:00 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/2007/12/25/added_to_stage/</guid>
		<description><![CDATA[One of those things&#8230; The event ADDED_TO_STAGE, dispatched by any DisplayObject when it gets added to the stage (duh) as opposed to added to a parent, wasn&#8217;t available in Flash player 9 before 9.0.28. That basically means we can&#8217;t really trust it will be available until statistics prove that any and all minor releases prior [...]]]></description>
			<content:encoded><![CDATA[<p>One of those things&#8230; The event ADDED_TO_STAGE, dispatched by any DisplayObject when it gets added to the stage (duh) as opposed to added to a parent, wasn&#8217;t available in Flash player 9 before 9.0.28. That basically means we can&#8217;t really trust it will be available until statistics prove that any and all minor releases prior to that one have disappeared from the face of the earth. So instead of that, we have to use Moock&#8217;s solution (but that&#8217;s a hell of a lot of work to be notified of just one little event), or check the event&#8217;s phase (also thanks to Moock): 
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">private</span> <span class="kw3">function</span> handleAdded <span class="br0">&#40;</span>e : <a href="http://www.google.com/search?q=Event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:Event.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">Event</span></a><span class="br0">&#41;</span> : <span class="kw1">void</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>e.<span class="kw7">eventPhase</span> != <a href="http://www.google.com/search?q=EventPhase%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:EventPhase.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">EventPhase</span></a>.<span class="kw8">AT_TARGET</span><span class="br0">&#41;</span> <span class="kw1">return</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// do something useful</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2007/12/25/added_to_stage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FDT &amp; automatic class name generation in Flash CS3</title>
		<link>http://stephan.acidcats.nl/blog/2007/11/25/fdt-automatic-class-name-generation-in-flash-cs3/</link>
		<comments>http://stephan.acidcats.nl/blog/2007/11/25/fdt-automatic-class-name-generation-in-flash-cs3/#comments</comments>
		<pubDate>Sun, 25 Nov 2007 20:48:08 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/2007/11/25/fdt-automatic-class-name-generation-in-flash-cs3/</guid>
		<description><![CDATA[The function flash.utils.getDefinitionByName has been discussed in various other places (amongst others here and of course in the documentation), but it took a bit of a mental jump to use it as the solution for the problem that linked library instances without a class are not known inside FDT.Suppose we have a library item with a [...]]]></description>
			<content:encoded><![CDATA[<p>The function <code>flash.utils.getDefinitionByName</code> has been discussed in various other places (amongst others <a href="http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/">here</a> and of course <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/package.html#getDefinitionByName()">in the documentation</a>), but it took a bit of a mental jump to use it as the solution for the problem that linked library instances without a class are not known inside FDT.Suppose we have a library item with a linkage id of &#8220;square&#8221;, and we decide not to attach a class to it. Flash CS3 reminds us that it will create one for us, and if we code inside the Flash IDE, we can happily write: <code>var s:Sprite = new square(); addChild(s);</code>However, FDT will show an error, because it doesn&#8217;t have a clue what you&#8217;re talking about. To solve this, use <code>getDefinitionByName("square")</code>, as shown in the following example:
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">package</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">import</span> <span class="kw6">flash.display</span>.<a href="http://www.google.com/search?q=MovieClip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:MovieClip.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">MovieClip</span></a>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">import</span> <span class="kw6">flash.display</span>.<a href="http://www.google.com/search?q=Sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:Sprite.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">Sprite</span></a>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">import</span> <span class="kw6">flash.utils</span>.<span class="kw7">getDefinitionByName</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">class</span> Application extends <a href="http://www.google.com/search?q=MovieClip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:MovieClip.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">MovieClip</span></a> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">private</span> static const LINKAGE_SQUARE:<a href="http://www.google.com/search?q=String%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:String.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">String</span></a> = <span class="st0">&quot;square&quot;</span>; </div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">public</span> <span class="kw3">function</span> Application <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> s:<a href="http://www.google.com/search?q=Sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:Sprite.html&#038;filter=0&#038;num=100&#038;btnI=lucky"><span class="kw5">Sprite</span></a> = <span class="kw1">new</span> <span class="br0">&#40;</span><span class="kw7">getDefinitionByName</span><span class="br0">&#40;</span>LINKAGE_SQUARE<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw7">addChild</span><span class="br0">&#40;</span>s<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2007/11/25/fdt-automatic-class-name-generation-in-flash-cs3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning Flash CS3 &amp; Actionscript 3 &#8211; Automatically declaring stage instances</title>
		<link>http://stephan.acidcats.nl/blog/2007/08/29/learning-flash-cs3-actionscript-3-automatically-declaring-stage-instances/</link>
		<comments>http://stephan.acidcats.nl/blog/2007/08/29/learning-flash-cs3-actionscript-3-automatically-declaring-stage-instances/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 12:30:10 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/2007/08/29/learning-flash-cs3-actionscript-3-automatically-declaring-stage-instances/</guid>
		<description><![CDATA[In the publish settings, you have the option (on by default) to have named child instances inside a particular MovieClip instance declared in the created class automatically.
Suppose we have a class MainController as Document Class, and a library item instanced on the root timeline with name &#8220;myClip_mc&#8221;. When automatically declaring instances, I can talk to [...]]]></description>
			<content:encoded><![CDATA[<p>In the publish settings, you have the option (on by default) to have named child instances inside a particular MovieClip instance declared in the created class automatically.</p>
<p>Suppose we have a class MainController as Document Class, and a library item instanced on the root timeline with name &#8220;myClip_mc&#8221;. When automatically declaring instances, I can talk to a member property myClip_mc inside my MainController class. That may sound handy, but any self-respecting code editor with checking will start nagging that myClip_mc has not been declared. And since it hasn&#8217;t been declared, it&#8217;s untyped, therefore we don&#8217;t have code hinting. So not that handy after all.</p>
<p>Now let&#8217;s not declare instances automatically. Since we didn&#8217;t declare anything in the MainController class, the Flash player will try adding myClip_mc at runtime to the MainController instance, and fail with a runtime error, provided you didn&#8217;t declare MainController as a dynamic class. And you shouldn&#8217;t. So we add a public var myClip_mc:MovieClip (yes, public!) to our MainController, we get code hinting &amp; compile time type checking, and everything compiles and runs fine. Perfect.</p>
<p>Well&#8230; suppose, for the sake of convience, or out of laziness, or for whatever reason, we happen to have a bunch of named instances on our timeline that we will look into later. We haven&#8217;t come to that part yet, so we haven&#8217;t bothered declaring them in the MainController class&#8230; Wrong! We&#8217;ll get a runtime error for the first undeclared named instance that can&#8217;t be added, after which the Flash player stops.</p>
<p>So to quote Cruijff, every upside has its downside. The good thing is of course that now at least we get a runtime error if we typed the instance name wrong in the class vs. the timeline.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2007/08/29/learning-flash-cs3-actionscript-3-automatically-declaring-stage-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac&#8217;s Genie effect in Flash</title>
		<link>http://stephan.acidcats.nl/blog/2007/08/28/macs-genie-effect-in-flash/</link>
		<comments>http://stephan.acidcats.nl/blog/2007/08/28/macs-genie-effect-in-flash/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 13:44:14 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://stephan.acidcats.nl/blog/2007/08/28/macs-genie-effect-in-flash/</guid>
		<description><![CDATA[I guess, even as a Windows developer, you will notice it when your Interaction Designer and/or Visual Designer has a Mac. About every effect Mac OS X offers, has to be repeated at some point in some Flash application. So can do you all of the following?

mirroring
Expose
Icon Dock
iTunes
Coverflow
Genie

So here&#8217;s a first version of the Genie effect. Not very flexible yet, [...]]]></description>
			<content:encoded><![CDATA[<p>I guess, even as a Windows developer, you will notice it when your Interaction Designer and/or Visual Designer has a Mac. About every effect Mac OS X offers, has to be repeated at some point in some Flash application. So can do you all of the following?</p>
<ul>
<li>mirroring</li>
<li>Expose</li>
<li>Icon Dock</li>
<li>iTunes</li>
<li>Coverflow</li>
<li>Genie</li>
</ul>
<p>So here&#8217;s a first version of the Genie effect. Not very flexible yet, but the direction is there. See the <a href="http://stephan.acidcats.nl/blog/wp-content/main.swf">swf</a> for the effect: click on the image to make it go icon, click again to make it pop back up.<br />
The code can be found <a href="http://stephan.acidcats.nl/blog/wp-content/maincontroller-genie.zip">here</a>. It requires the <a title="ASAPFramework" href="http://www.asapframework.org" target="_blank">ASAPFramework</a> v0.94 in your classpath, and a single image in the library with a linkage id.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephan.acidcats.nl/blog/2007/08/28/macs-genie-effect-in-flash/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

