<?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/"
	>

<channel>
	<title>Apt Labs</title>
	<atom:link href="http://labs.apt.no/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.apt.no</link>
	<description>Mixing potions since 99'</description>
	<pubDate>Fri, 20 Aug 2010 12:27:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTML5 canvas particle experiment</title>
		<link>http://labs.apt.no/2010/08/20/html5-canvas-particle-experiment/</link>
		<comments>http://labs.apt.no/2010/08/20/html5-canvas-particle-experiment/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 12:25:17 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=875</guid>
		<description><![CDATA[
One of my first experiments with HTML5 canvas. Particles with gravity, moving against each other depending on the mass / size of each circle. Added some controls, so you can mess around with it. I did not have time to make controls for number of particles on screen, but maybe i&#8217;ll fix it later. No framework [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.apt.no/experiments/canvas-particles/"><img class="alignnone size-full wp-image-879" title="canvas-particles1" src="http://labs.apt.no/wp-content/uploads/2010/08/canvas-particles1.jpg" alt="canvas-particles1" width="580" height="238" /></a></p>
<p>One of my first experiments with HTML5 canvas. Particles with gravity, moving against each other depending on the mass / size of each circle. Added some controls, so you can mess around with it. I did not have time to make controls for number of particles on screen, but maybe i&#8217;ll fix it later. No framework used, except from jQuery for the controls. The experiment is optimized for webkit, and there are some known bugs <img src='http://labs.apt.no/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://labs.apt.no/experiments/canvas-particles/">Check it!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/08/20/html5-canvas-particle-experiment/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Multi-touch html demo/experiment (for iOS)</title>
		<link>http://labs.apt.no/2010/08/18/multi-touch-html-demoexperiment-for-iphone/</link>
		<comments>http://labs.apt.no/2010/08/18/multi-touch-html-demoexperiment-for-iphone/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 08:59:57 +0000</pubDate>
		<dc:creator>Pål</dc:creator>
		
		<category><![CDATA[Flash]]></category>

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

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

		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=866</guid>
		<description><![CDATA[On HP&#8217;s little challenge to show HTML5/Canvas stuff (beatiful vid btw.), here we go  
I had some time in June to experiment with iPhone web-apps and its proprietary Safari html. As a flash developer it was a fun to get my hands dirty and work with a little in the non-strict world of Javscript.
The [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-868 alignright" title="Screenshot from the app" src="http://labs.apt.no/wp-content/uploads/2010/08/bilde-253x300.jpg" alt="Screenshot from the app" width="253" height="300" />On <a href="http://labs.apt.no/2010/08/18/show-and-tell-openframeworks-cinder/">HP&#8217;s little challenge</a> to show HTML5/Canvas stuff (beatiful vid btw.), here we go <img src='http://labs.apt.no/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I had some time in June to experiment with iPhone web-apps and its proprietary Safari html. As a flash developer it was a fun to get my hands dirty and work with a little in the non-strict world of Javscript.</p>
<p>The idea of the web-app was to demonstrate multi-touch in a web-app and also for it to be a little playful drawing tool. The user can draw series of ribbons by swiping two or more fingers across the screen, creating a trail after the movements. Have a go at it on your iPhone or iPad, but remember to use two or more fingers.</p>
<p><a href="http://bit.ly/9n0Q0O" target="_blank">Use your iPhone/iPad/iPhone touch and press here</a></p>
<p>Adding it to the home screen will also create a nice icon and it will run in fullscreen.</p>
<p>In this demo I&#8217;ve been using:</p>
<ul>
<li>CSS3 (webkit-*) for 3D perspective</li>
<li>Canvas for drawing</li>
<li>Safari multi-touch events for user input</li>
<li>Icon for the home screen (apple-touch-icon)</li>
<li>Picture for the splash screen (apple-touch-startup-image)</li>
</ul>
<p>For docs I mostly used developer.apple.com and the odd Google search. You are welcome to take a peek at the (single file) code if you are interested in how it works. Feedback is also welcome, ie. I dont think it works optimally on the Ipad. I havent got one <strong>yet</strong> <img src='http://labs.apt.no/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>PS. I have already got reports that this doesn&#8217;t work on Android (surprise!). But I dunno if that was a multi-touch enabled one.</p>
<p>Pål - twitter.com/paalsa</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/08/18/multi-touch-html-demoexperiment-for-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Show and Tell: OpenFrameworks &#124;&#124; Cinder.</title>
		<link>http://labs.apt.no/2010/08/18/show-and-tell-openframeworks-cinder/</link>
		<comments>http://labs.apt.no/2010/08/18/show-and-tell-openframeworks-cinder/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 07:02:36 +0000</pubDate>
		<dc:creator>hp.</dc:creator>
		
		<category><![CDATA[Flash]]></category>

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

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

		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=861</guid>
		<description><![CDATA[I would love to see what you people are doing out there with cinder and openFrameworks.
Here&#8217;s my first stab. CinderFlow code hosted on github.

Oh, all right, show your HTML5/Canvas stuff as well!
]]></description>
			<content:encoded><![CDATA[<p>I would love to see what you people are doing out there with <a href="http://libcinder.org/">cinder</a> and <a href="http://openframeworks.cc">openFrameworks</a>.</p>
<p>Here&#8217;s my first stab. <a href="http://github.com/hpeikemo/CinderFlow">CinderFlow code hosted on github</a>.<br />
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/35j9uJ40u28?hl=en_US" frameborder="0"></iframe></p>
<p>Oh, all right, show your HTML5/Canvas stuff as well!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/08/18/show-and-tell-openframeworks-cinder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>5 minute recipe for simple&#8217;n'easy export from symfony to Excel</title>
		<link>http://labs.apt.no/2010/06/15/5-minute-recipe-for-simpleneasy-export-from-symfony-to-excel/</link>
		<comments>http://labs.apt.no/2010/06/15/5-minute-recipe-for-simpleneasy-export-from-symfony-to-excel/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 14:25:19 +0000</pubDate>
		<dc:creator>Erland</dc:creator>
		
		<category><![CDATA[Serverside]]></category>

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

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

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

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

		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=838</guid>
		<description><![CDATA[So your client wants her data in Excel format? Not to worry. After reading this, you will be able to deliver data to her in a matter of minutes. Having said that, please bear in mind that it is not a generic solution for delivering dynamic Excel spreadsheets, merely a quick-fix solution.
But, you knew that [...]]]></description>
			<content:encoded><![CDATA[<p>So your client wants her data in Excel format? Not to worry. After reading this, you will be able to deliver data to her in a matter of minutes. Having said that, please bear in mind that it is not a generic solution for delivering dynamic Excel spreadsheets, merely a quick-fix solution.</p>
<p>But, you knew that already, didn&#8217;t you? Please read on for the good stuff&#8230;</p>
<p><span id="more-838"></span></p>
<p>You have your data, now fetch it in an action:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
   * Executes Excel action
   *
   * @param sfRequest $request A request object
   */</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeExcel<span style="color: #009900;">&#40;</span>sfWebRequest <span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Ymd'</span><span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setContentType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'application/msexcel'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHttpHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Disposition'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'inline; filename=&quot;subscribers'</span><span style="color: #339933;">.</span><span style="color: #000088;">$date</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.xls&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span> <span style="color: #339933;">=</span> Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Subscriber'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAllJoinAll</span><span style="color: #009900;">&#40;</span>Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">HYDRATE_ARRAY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then show it using this finely tuned template (excelSuccess.php):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;style&gt;
  table{
    font-family: Helvetica, Arial, sans-serif;
  }
  th, td{
    text-align: left;
  }
&lt;/style&gt;
&lt;table&gt;
  &lt;thead&gt;
    &lt;th&gt;E-post&lt;/th&gt;
    &lt;th&gt;Fylke&lt;/th&gt;
    &lt;th&gt;Organisasjon&lt;/th&gt;
    &lt;th&gt;Opprettet&lt;/th&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;tr&gt;
      &lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
      &lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'County'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
      &lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Organisation'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
      &lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created_at'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
    &lt;/tr&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/tbody&gt;
  &lt;tfoot&gt;
    &lt;td colspan=&quot;4&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> abonnenter hentet <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d.m.Y, kl H:i:s'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
  &lt;/tfoot&gt;
&lt;/table&gt;</pre></div></div>

<p>That&#8217;s it, my friend. Now go grab a beer in the sun.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/06/15/5-minute-recipe-for-simpleneasy-export-from-symfony-to-excel/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Oldschool dissolve function</title>
		<link>http://labs.apt.no/2010/04/26/oldschool-dissolve-function/</link>
		<comments>http://labs.apt.no/2010/04/26/oldschool-dissolve-function/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 11:58:59 +0000</pubDate>
		<dc:creator>Thomas H</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[8bit]]></category>

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

		<category><![CDATA[dissolve]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=829</guid>
		<description><![CDATA[While doing a recent project I wanted to create a fade effect that worked well with the 8bit style design of the application. I wanted to use the dissolve effect, and lo and behold, flash has that function built in to the BitmapData class ( pixelDissolve ). Only problem was that the dissolve is on [...]]]></description>
			<content:encoded><![CDATA[<p>While doing a recent project I wanted to create a fade effect that worked well with the 8bit style design of the application. I wanted to use the dissolve effect, and lo and behold, flash has that function built in to the BitmapData class ( pixelDissolve ). Only problem was that the dissolve is on a pixel to pixel basis, so it did not look really authentic to a 8bit based graphics. All that was needed to do was to mimic the pixelDissolve function but apply them to squares of pixels.</p>
<p><span id="more-829"></span></p>
<p>First off you need to &#8220;flatten&#8221; the object you are gonna dissolve, by copying its children to a bitmap, then hiding/removing all children. ( The code is in no way optimized but it works well for small objects. The heaviest part is the copying of all children to a bitmap. )</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> copyThisAndHideAllVisible<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>_bitmap<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		_bitmap = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Bitmap</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	showAllChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	_bitmapData = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">BitmapData</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>, <span style="color: #004993;">height</span>, <span style="color: #0033ff; font-weight: bold;">true</span>, 0x00000000<span style="color: #000000;">&#41;</span>;
	_bitmapData.<span style="color: #004993;">draw</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span>;
	_bitmap.<span style="color: #004993;">bitmapData</span> = _bitmapData;
&nbsp;
	hideAllChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_bitmap<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The dissolve function:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> chunkDissolve<span style="color: #000000;">&#40;</span>coverage<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> bmd<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">BitmapData</span> = _bitmapData;
	<span style="color: #6699cc; font-weight: bold;">var</span> oh<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = bmd.<span style="color: #004993;">rect</span>.<span style="color: #004993;">height</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> w<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = bmd.<span style="color: #004993;">rect</span>.<span style="color: #004993;">width</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> h<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = bmd.<span style="color: #004993;">rect</span>.<span style="color: #004993;">height</span>;
&nbsp;
	<span style="color: #6699cc; font-weight: bold;">var</span> seed<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> square<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">3</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">while</span><span style="color: #000000;">&#40;</span>w <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	    w <span style="color: #000000; font-weight: bold;">-</span>= square;
	    <span style="color: #0033ff; font-weight: bold;">while</span><span style="color: #000000;">&#40;</span>h <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		h <span style="color: #000000; font-weight: bold;">-</span>= square;
		seed = <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>seed <span style="color: #000000; font-weight: bold;">&amp;</span>lt;= coverage<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span>;i <span style="color: #000000; font-weight: bold;">&amp;</span>lt; square;i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			    <span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span>;j <span style="color: #000000; font-weight: bold;">&amp;</span>lt; square;j<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				bmd.<span style="color: #004993;">setPixel32</span><span style="color: #000000;">&#40;</span>w<span style="color: #000000; font-weight: bold;">+</span>i, h<span style="color: #000000; font-weight: bold;">+</span>j, 0x00000000<span style="color: #000000;">&#41;</span>;
			    <span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	   <span style="color: #000000;">&#125;</span>
	   h = oh;
	<span style="color: #000000;">&#125;</span>
	_bitmap.<span style="color: #004993;">bitmapData</span> = bmd;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>coverage == <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	    _bitmap.<span style="color: #004993;">visible</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>use your favourite tween engine to tween the percentage of dissolve over a period of time:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> dissolve<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> _dissolve;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> dissolve<span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	_dissolve = <span style="color: #004993;">value</span>;
	chunkDissolve<span style="color: #000000;">&#40;</span>_dissolve<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Always set dissolve to 0 and tween it up to 1. This will dissolve out the object. If you want a a similar effect dissolving the object in, apply the dissolve to an overlaying object with blendMode = BlendMode.ERASE. If so remember to set the parents blendMode to BlendMode.LAYER.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/04/26/oldschool-dissolve-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Keep your flags in order.</title>
		<link>http://labs.apt.no/2010/04/21/keep-your-flags-in-order/</link>
		<comments>http://labs.apt.no/2010/04/21/keep-your-flags-in-order/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 09:14:24 +0000</pubDate>
		<dc:creator>hp.</dc:creator>
		
		<category><![CDATA[Flash]]></category>

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

		<category><![CDATA[Snippet]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=824</guid>
		<description><![CDATA[use a go style iota operator:

package rendering &#123;
	public class RenderFlags &#123;
&#160;
		private static var _i:uint;
		private static function get iota&#40;&#41;:uint &#123; return _i++; &#125;
&#160;
		public static const GENERIC:uint		= 0x1&#60;&#60;iota;
		public static const DIMENSIONS:uint 		= 0x1&#60;&#60;iota;
		public static const POSITION:uint 		= 0x1&#60;&#60;iota;
		public static const SCALE:uint 			= 0x1&#60;&#60;iota;
		public static const CHILDREN:uint 		= 0x1&#60;&#60;iota;
&#160;
&#160;
		public static const BOUNDS:uint = DIMENSIONS &#124; POSITION;
		public static const [...]]]></description>
			<content:encoded><![CDATA[<p>use a go style iota operator:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> rendering <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> RenderFlags <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> _i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> iota<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> <span style="color: #000000;">&#123;</span> <span style="color: #0033ff; font-weight: bold;">return</span> _i<span style="color: #000000; font-weight: bold;">++</span>; <span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const GENERIC<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>		= 0x1<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>iota;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const DIMENSIONS<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> 		= 0x1<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>iota;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const POSITION<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> 		= 0x1<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>iota;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const SCALE<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> 			= 0x1<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>iota;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const CHILDREN<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> 		= 0x1<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>iota;
&nbsp;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const BOUNDS<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = DIMENSIONS <span style="color: #000000; font-weight: bold;">|</span> POSITION;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const ALL<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight: bold;">~</span> 0x0;		
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/04/21/keep-your-flags-in-order/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;HTML5&#8243; versus Flash: Animation Benchmarking</title>
		<link>http://labs.apt.no/2010/04/14/html5-versus-flash-animation-benchmarking/</link>
		<comments>http://labs.apt.no/2010/04/14/html5-versus-flash-animation-benchmarking/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 11:40:17 +0000</pubDate>
		<dc:creator>Pål</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flash HTML5]]></category>

		<guid isPermaLink="false">http://labs.apt.no/2010/04/14/html5-versus-flash-animation-benchmarking/</guid>
		<description><![CDATA[Check out this test, benchmarking a particle system with &#8220;HTML/Browser&#8221; against Flash. Seems like Flash still has the upper hand in pure animation power:
 http://www.themaninblue.com/writing/perspective/2010/03/22
Is the only hope IE9? HW/GPU is needed to kick some ass here&#8230;
Also check out this test, done on the Google Nexus One.
 http://vimeo.com/10553088
]]></description>
			<content:encoded><![CDATA[<p>Check out this test, benchmarking a particle system with &#8220;HTML/Browser&#8221; against Flash. Seems like Flash still has the upper hand in pure animation power:<br />
<a href="http://www.themaninblue.com/writing/perspective/2010/03/22"> http://www.themaninblue.com/writing/perspective/2010/03/22</a></p>
<p>Is the only hope IE9? HW/GPU is needed to kick some ass here&#8230;</p>
<p>Also check out this test, done on the Google Nexus One.<br />
<a href="http://vimeo.com/10553088"> http://vimeo.com/10553088</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/04/14/html5-versus-flash-animation-benchmarking/feed/</wfw:commentRss>
		</item>
		<item>
		<title>iPhone apps built with with Flash CS5</title>
		<link>http://labs.apt.no/2010/02/02/iphone-apps-built-with-with-flash-cs5/</link>
		<comments>http://labs.apt.no/2010/02/02/iphone-apps-built-with-with-flash-cs5/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 08:05:19 +0000</pubDate>
		<dc:creator>Pål</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flash iPhone]]></category>

		<guid isPermaLink="false">http://labs.apt.no/2010/02/02/iphone-apps-built-with-with-flash-cs5/</guid>
		<description><![CDATA[In the middle of all the &#8220;Flash on the iPad&#8221; controversy, it can be a little soothing to watch this video demoing apps built with upcoming Flash CS5.
http://theflashblog.com/?p=1737
]]></description>
			<content:encoded><![CDATA[<p>In the middle of all the &#8220;Flash on the iPad&#8221; controversy, it can be a little soothing to watch this video demoing apps built with upcoming Flash CS5.</p>
<p><a href="http://theflashblog.com/?p=1737">http://theflashblog.com/?p=1737</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/02/02/iphone-apps-built-with-with-flash-cs5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Image burn out effect in AS3</title>
		<link>http://labs.apt.no/2010/01/18/image-burn-out-effect-in-as3/</link>
		<comments>http://labs.apt.no/2010/01/18/image-burn-out-effect-in-as3/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 10:51:29 +0000</pubDate>
		<dc:creator>Thomas H</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=815</guid>
		<description><![CDATA[Use your favourite tween engine and tween a property like so:

       public function get burn&#40;&#41; : Number &#123;
         return _burn;
	&#125;
&#160;
	public function set burn&#40;value:Number&#41; : void &#123;
	  _burn = value;
	  var CF:Array = &#91;1,0,0,0,255*_burn,
       [...]]]></description>
			<content:encoded><![CDATA[<p>Use your favourite tween engine and tween a property like so:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">       <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> burn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> <span style="color: #000000;">&#123;</span>
         <span style="color: #0033ff; font-weight: bold;">return</span> _burn;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> burn<span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	  _burn = <span style="color: #004993;">value</span>;
	  <span style="color: #6699cc; font-weight: bold;">var</span> CF<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">255</span><span style="color: #000000; font-weight: bold;">*</span>_burn,
                                  <span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">255</span><span style="color: #000000; font-weight: bold;">*</span>_burn,
                                  <span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">255</span><span style="color: #000000; font-weight: bold;">*</span>_burn,
                                  <span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">255</span><span style="color: #000000; font-weight: bold;">*</span>_burn<span style="color: #000000;">&#93;</span>;
	  <span style="color: #004993;">filters</span> = <span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ColorMatrixFilter</span><span style="color: #000000;">&#40;</span>CF.<span style="color: #004993;">concat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>;
        <span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/01/18/image-burn-out-effect-in-as3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash9 Popup-blocker developments.</title>
		<link>http://labs.apt.no/2010/01/12/flash9-popup-blocker-developments/</link>
		<comments>http://labs.apt.no/2010/01/12/flash9-popup-blocker-developments/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 08:51:23 +0000</pubDate>
		<dc:creator>hp.</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://labs.apt.no/?p=810</guid>
		<description><![CDATA[For an introduction on the issue, check the old post Flash 9 for banner-ads (in norwegian).
Download the source files.
Most recent browsers support both navigateToURL and ExternalInterface. However, successful calls to the js-function do not return &#8220;YES&#8221; nor &#8220;NO&#8221; but null, causing the navigateToURL method to be called as well.

function openWindowAutoHandler&#40;event:Event&#41;:void &#123;
  if &#40;externalInterfaceAvailable&#41; &#123;
 [...]]]></description>
			<content:encoded><![CDATA[<p>For an introduction on the issue, check the old post <a href="http://labs.apt.no/2009/05/04/flash9/">Flash 9 for banner-ads</a> (in norwegian).</p>
<p><a href="http://labs.apt.no/wp-content/uploads/2010/01/flash9_cs3_debug.zip">Download the source files</a>.</p>
<p>Most recent browsers support both navigateToURL and ExternalInterface. However, successful calls to the js-function do not return &#8220;YES&#8221; nor &#8220;NO&#8221; but null, causing the navigateToURL method to be called as well.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #339966; font-weight: bold;">function</span> openWindowAutoHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
  <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>externalInterfaceAvailable<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">var</span> openEIresult<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">ExternalInterface</span>.<span style="color: #004993;">call</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'function() {return (window.open(&quot;'</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>clickTAG<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">'&quot;, &quot;_blank&quot;, &quot;&quot;) ? &quot;YES&quot; : &quot;NO&quot;) }'</span><span style="color: #000000;">&#41;</span>;	
  <span style="color: #000000;">&#125;</span>      
  <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>externalInterfaceAvailable<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #000000;">&#40;</span>openEIresult <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #990000;">&quot;YES&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #000000;">&#40;</span>userAgentString.<span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Opera&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">navigateToURL</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span>clickTAG<span style="color: #000000;">&#41;</span>, <span style="color: #990000;">&quot;_blank&quot;</span><span style="color: #000000;">&#41;</span>;		
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>openEIresult in Internet Explorer 7.0: null (Loads the URL twice)<br />
openEIresult in Internet Explorer 8.0: null (Loads the URL twice)<br />
openEIresult in Firefox 3.5.6: &#8220;YES&#8221;	(Works as intended)<br />
openEIresult in Opera 10.10: &#8220;YES&#8221; (Loads the URL twice, caused by third test)</p>
<p>Anyone think of a clever fix to the dual dual loads issue, while still retaining compatibility with older browsers?</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.apt.no/2010/01/12/flash9-popup-blocker-developments/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
