<?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>The Nordhagen</title>
	<atom:link href="http://www.oyvindnordhagen.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oyvindnordhagen.com/blog</link>
	<description>Øyvind Nordhagen on ActionScript and other things</description>
	<lastBuildDate>Fri, 20 Jan 2012 13:06:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The case for BindMax for data binding</title>
		<link>http://www.oyvindnordhagen.com/blog/2012/01/19/the-case-for-bindmax-for-data-binding/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2012/01/19/the-case-for-bindmax-for-data-binding/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 21:33:44 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[BindLite]]></category>
		<category><![CDATA[BindMax]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[bindlite]]></category>
		<category><![CDATA[bindmax]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=676</guid>
		<description><![CDATA[I made a couple of small updates to BindMax today (read about them at the bottom of the post). I&#8217;ve been using it myself for several projects and it has easily become one of my favorite self-made tools. It&#8217;s been [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/blog/bindmax"><img class="alignnone size-full wp-image-694" title="BindMax" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2012/01/BindMax.jpg" alt="" width="555" height="148" /></a><br />
I made a couple of small updates to BindMax today (read about them at the bottom of the post). I&#8217;ve been using it myself for several projects and it has easily become one of my favorite self-made tools. It&#8217;s been been rock solid and serving me very well and I feel like more people should be using it. But maybe you don&#8217;t know what it improves upon? Let me help you.</p>
<p>Data binding is essentially tha synchonization of values, typically between the model and the views (read more <a href="http://en.wikipedia.org/wiki/Data_binding">here</a>. For Flex applications data binding is typically accomplished with the [Bindable] compiler meta tag. For pure AS3 applications it&#8217;s been a roll-your-own world and some even use [Bindable] here as well. This is just wrong.</p>
<p>These are the reasons why BindMax is better than [Bindable]:</p>
<ul>
<li><strong>Mobile loving</strong><br />
Building mobile apps with AIR? Then you know it&#8217;s all about squeezing file size out and performace in. BindMax is an implementation of the observer pattern, which is a much simpler structure than the Flash Event bus. In fact it&#8217;s beautiful minimalism compared the Events. Smaller file size, better performance.</li>
<li><strong>Speed!</strong><br />
For primitive data types BindMax is generally 3x faster than [Bindable]. Performance with complex data types obviously depends on how fast your compare functions are, if you have any. Without them, complex data types propagate just as fast as the primitve ones. The speed tests are included with the source so check for yourself!</li>
<li><strong>Early type checking</strong><br />
A data binding is usually defined early in the application run cycle. When that happens, BindMax will evaluate each attempt to bind a property or setter against the data type of the binding and throw an error if the data types don&#8217;t match. With [Bindable], you get no errors until the target property/setter for that binding is used. For a property that is used only rarely, you may never even see that error until the client/user stumbles over that rare use case and tells you.</li>
<li><strong>Boot time property/getter/setter name validation on both sides of data binding</strong><br />
Just as with type checking, BindMax validates that that the names match between the property or setter you bind a property or getter to.</li>
<li><strong>Easy custom compare functions for complex and custom data types</strong><br />
Primitive data type values like numbers and strings are easy to compare. Complex data types like arrays, dictionaries and custom objects require special handling. For this scenario, BindMax provides setCompareFunction which lets you pass it a function reference to a custom function that takes two instances of the same class and returns true if they are equal.</li>
<li><strong>Optional automatic binding disposal</strong><br />
To play nice with the garbage collector, BindMax lets you turn on automatic disposal of bindings which are no longer in use. When the last target for a binding is removed, BindMax will dispose of it.</li>
<li><strong>Previous value retrieval</strong><br />
BindMax stores the last value of each binding so you can retrieve it with retrieveLast if for comparison with the new value. The typical use case for this functionality is an animated image gallery where animation direction is determined based on image index vs previous image index. I&#8217;m sure you can think of several others.</li>
<li><strong>Powerful reset function</strong><br />
With the reset function, you can reset any or all of the bound properties to their default values (value of the property when the binding was defined). A quick call to reset followed by propagateAll will effectively reset you application.</li>
<li><strong>Propagation forcing</strong><br />
There are times when checking if a value is in fact changed simply doesn&#8217;t make sense. Then you wanna be sure that a value spreads to you application each time it is set, even if hasn&#8217;t changed. BindMax lets you override change detection on a per-update or per-property basis.</li>
</ul>
<p>So go get it! At <a href="http://code.google.com/p/bindlite/downloads/list">Google Code</a></p>
<p>NOTE: From now on I will be talking mostly about BindMax instead of it&#8217;s little brother BindLite. I&#8217;m leaving BindLite in the source in case someone finds it useful, but BindMax is much more verastile by not being an all static access class.</p>
<p>I&#8217;ve also updated <a href="/blog/bindlite">the BindMax tutorial</a></p>
<p>The updates I made were the following:</p>
<ul>
<li>Added reset all functionality when calling reset without arguments</li>
<li>Added setForcedPropagation function</li>
<li>Added propagateAll function</li>
<li>Removed outdated example project</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2012/01/19/the-case-for-bindmax-for-data-binding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drawing a motherf**king dashed line in AS3</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/12/14/drawing-a-motherfking-dashed-line-in-as3/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/12/14/drawing-a-motherfking-dashed-line-in-as3/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 21:57:34 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[dash]]></category>
		<category><![CDATA[dashed]]></category>
		<category><![CDATA[dotted]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[draw]]></category>
		<category><![CDATA[drawing api]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[line]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=644</guid>
		<description><![CDATA[Here's an easy, reasonably fast way to draw a dashed line in ActionScript.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/public/DashedLine.as"><img class="alignnone size-full wp-image-645" title="Dashed Line" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/12/Screen-Shot-2011-12-14-at-22.53.50.png" alt="" width="531" height="269" /></a></p>
<p>I needed to draw a dashed line in AS3. I thought it would be easy, but I thought &#8220;hey, that one&#8217;s already been covered&#8221;, expecting that if I could find some ready-made class or lib that would do the job, I might even get some extra benefits. I went on this great interweb page called Google and I searched for &#8220;Dashed Line AS3&#8243;.</p>
<p>I was disappointed at all the feeble attempts at doing something so simple, so after a couple of attempts i did it myself. I even threw in the added benefit of making it able to draw itself between two points you supply it. I was expecting something extra so I imagine you did too.</p>
<p>Here ya&#8217; go:</p>
<p><a href="http://www.oyvindnordhagen.com/public/DashedLine.as">DashedLine.as</a></p>
<p>PS: Damn, that drop shadow Mac OS X includes in window screenshots is really something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/12/14/drawing-a-motherfking-dashed-line-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FIX: Garmin sync hangs at 50%</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/12/01/fix-garmin-sync-hangs-at-50/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/12/01/fix-garmin-sync-hangs-at-50/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 22:10:55 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[communicator]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[crashes]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[fails]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[forerunner]]></category>
		<category><![CDATA[garmin]]></category>
		<category><![CDATA[hangs]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[stall]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[unable]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=634</guid>
		<description><![CDATA[Stable workaround for the Garmin Connect plug-in problem where sync stalls at 50%.]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-635" title="sbbod" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/12/sbbod.jpg" alt="" width="630" height="269" /><br />
Completely unrelated post if you&#8217;re used to the usual ActionScript stuff I&#8217;m posting, but this has been bothering me for so long. I just want to put this out there now that I finally found a solution.</p>
<p>If you&#8217;re like me in that you exercise and you track your workouts with a Garmin device, there&#8217;s a chance that you&#8217;ve experienced the situation where the sync will hang about halfway through.</p>
<h3>Why?</h3>
<p>What seems to happen is that the Garmin Communicator plug-in is able to read the TCX-files off the device and onto disk (that&#8217;s the first 50% of the process), but crashes when it tries to upload the files to Gamin Connect, Dailymile, Runkeeper, Endomondo or any other site that uses the plug-in for sync with Garmin devices. There&#8217;s actually one progress bar for each of these steps on Garmin Connect, so the above image would not be completely accurate, the first bar would reach 100% and then it hangs.</p>
<h3>One solution..if you can call it that</h3>
<p>My previous solution would be to force quit the plug-in in Activity Monitor and try again until it finally worked (often as many as 6-8 attempts). I sync my runs to each of the four afformented websites (if only my friends could agree on the same site), so you can quickly see that this process becomes tedious.</p>
<h3>Better solution: Clear the cache</h3>
<p>What seems to be the problem is that the last TCX file that was synced is still in the browser cache and is somehow able to confuse to plug-in, because the solution to the problem is rather simple; clear your browser&#8217;s cache between each sync. This has proven to be a stable workaround for me for a while.</p>
<h3>A note on Garmin Support</h3>
<p>I&#8217;ve tried contacting Garmin Support several times about this, but no replies yet. The problem is even mentioned <a href="https://forums.garmin.com/search.php?searchid=5716658">several places on the Garmin Support forums</a>, but I doubt Garmin moderates or even monitors their own forum. An official response has yet to be made at least. I have a love-hate realationship with Garmin because I think they make hands down the best GPS HR monitors (<a href="http://www.oyvindnordhagen.com/blog/2010/10/02/garmin-forerunner-405cx-reviewwarning/">with some exceptions</a>), but at the same time their support is appalling and sadly I&#8217;m <a href="http://www.google.com/search?client=safari&amp;rls=en&amp;q=poor+garmin+support&amp;ie=UTF-8&amp;oe=UTF-8">far from the only one who thinks so</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/12/01/fix-garmin-sync-hangs-at-50/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BindLite gets a big brother</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/11/21/bindlite-gets-a-big-brother/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/11/21/bindlite-gets-a-big-brother/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 22:29:05 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[BindLite]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[bindlite]]></category>
		<category><![CDATA[bindmax]]></category>
		<category><![CDATA[data]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=629</guid>
		<description><![CDATA[Well not exactly bigger in terms of file size, but since BindLite was taken it had to be BindMax for its brother. BindLite was released earlier this year as a flex-less, event-less alternative to data binding in AS3. But whereas [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/bindlite/"><img class="alignnone size-full wp-image-571" title="BindLIte" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/02/BindLIte.jpg" alt="" width="487" height="228" /></a></p>
<p>Well not exactly bigger in terms of file size, but since BindLite was taken it had to be BindMax for its brother. BindLite was released earlier this year as a flex-less, event-less alternative to data binding in AS3. But whereas BindLite is a static class suitable for smaller projects, I quickly realized that to make it more usable, it could no longer be all static. Enter BindMax.</p>
<p>BindMax does exactly the same as BindLite does but with the added flexibility of being an instance. The recommended approach is to extend it for your Model class. Example:</p>
<pre lang="actionscript">public class MyModel extends BindMax {
	public var state:String = State.INPUT;
	public var captureDelay:uint = 0;
	public var capturePhase:String;
	public var currentSwf:SwfVO;
	public var error:ErrorVO;
	public var render:BitmapData;
}</pre>
<p>This is all you need for BindMax to do its magic. Your model class need no additional code, not even a constructor. As the superconstructor is implicitly called, BindMax will auto-enumerate all public variables and accessors as bindable with the correct data type for you. Explicitly calling the superconstructor lets you set the autoEnumerate argument to false if you wish to prevent this behaviour.</p>
<p>After this, all is the same as with BindLite with the exception that you need access to the MyModel instance. I recommend providing this acces through a dependency injection-driven framework such as <a href="http://www.robotlegs.org/">RobotLegs</a>.</p>
<p>Examples of use:</p>
<pre lang="actionscript">// Binding a property to a public property or setter on view
model.bind( "state", view );

// Property name needs to be passed as string, so using enums is recommended
model.bind( Bindable.STATE, view );

// Changing a property and propagate the change if value is different
model.update( Bindable.STATE, "main" );

// Changing a model property and force propagation
model.update( Bindable.STATE, "main", true );

// Resetting model properties to their values at define time
model.reset( Bindable.STATE, Bindable.FILE );

// Removing a data binding. Omit the second argument to unbind target from all data bindings
model.unbind( view, Bindable.STATE );

// Retrieve the before-change value of a bindable property
model.retrieveLast( Bindable.STATE );

// Control what happens when last target unbinds from a property
// true : Discard orphaned bindings
// false : retain orphaned bindins (default)
model.autoDisposeBindings = true;</pre>
<p>Download BindLIte and BindMax as a combined package here: <a href="http://code.google.com/p/bindlite/">http://code.google.com/p/bindlite/</a></p>
<p>Docs are here: <a href="http://www.oyvindnordhagen.com/bindlite/docs/">http://www.oyvindnordhagen.com/bindlite/docs/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/11/21/bindlite-gets-a-big-brother/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Circular Tron pattern generator</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/10/31/circular-tron-pattern-generator/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/10/31/circular-tron-pattern-generator/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 22:27:36 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[circular]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[print size]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[tron]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=624</guid>
		<description><![CDATA[Just as part of a fun little side project, I made this class to generate random circular Tron-like patterns. I thought I&#8217;d post it here in case anyone else likes the look of what it does. I&#8217;ve included an option [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/tron/"><img class="alignnone size-full wp-image-625" title="tron_pattern" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/10/tron_pattern.jpg" alt="" width="576" height="300" /></a></p>
<p>Just as part of a fun little side project, I made this class to generate random circular Tron-like patterns. I thought I&#8217;d post it here in case anyone else likes the look of what it does. I&#8217;ve included an option to save the image in 2880&#215;2880 pixels.</p>
<p>Se the Tron pattern generator here: <a href="http://www.oyvindnordhagen.com/tron/">www.oyvindnordhagen.com/tron/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/10/31/circular-tron-pattern-generator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Freebie: IPScanner</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/09/21/freebie-ipscanner/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/09/21/freebie-ipscanner/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 12:28:39 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[IPScanner]]></category>
		<category><![CDATA[p2p]]></category>
		<category><![CDATA[peer-to-peer]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[scan]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=615</guid>
		<description><![CDATA[So these days I&#8217;m experimenting with AIR P2P apps through the recently introduced ServerSocket class (which I think is still in beta by the way). Since the AIR API does not provide any network client/server/peer discovery tools, I decided to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/freebies/IPScanner.zip"><img class="alignnone size-full wp-image-616" title="IPScanner doing its job through Olog" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/09/Screen-Shot-2011-09-21-at-14.15.08.png" alt="IPScanner doing its job through Olog" width="479" height="229" /></a></p>
<p>So these days I&#8217;m experimenting with AIR P2P apps through the recently introduced ServerSocket class (which I think is still in beta by the way). Since the AIR API does not provide any network client/server/peer discovery tools, I decided to hack down a simple IP scanner to do the trick.</p>
<p>This package consists of two classes; IPScanner and IPScannerEvent. IPScanner will accept a starting IP and it will scan the rest of the range from that IP. In other words, if you pass in 192.168.1.100, it will try to &#8220;ping&#8221; each possible address from 192.168.1.100 to 192.168.1.255. Pass in 192.168.0, and it will go on all the way from 192.168.0.0 to 192.168.255.255, but it is limited to those last two segments.</p>
<p>An optional handshake string can also provided. In which case IPScanner will attempt to send this handshake string to each IP it is able to connect to and wait for a reply. This enables you to make sure you&#8217;re connecting to the right peer.</p>
<p>I find this works really well for me, so I thougt maybe someone else might need it too. Feel free to leave comments!</p>
<p><a href="http://www.oyvindnordhagen.com/freebies/IPScanner.zip"><img class="size-full wp-image-54 alignnone" title="zip" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2008/01/zip.gif" alt="" width="32" height="32" /></a><a href="http://www.oyvindnordhagen.com/freebies/IPScanner.zip">IPScanner.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/09/21/freebie-ipscanner/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Perlin Lines &#8211; A Beautiful Art Effect in AS3 Flash</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/08/29/perlin-lines-a-beautiful-art-effect-in-as3-flash/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/08/29/perlin-lines-a-beautiful-art-effect-in-as3-flash/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 07:00:00 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Shout!]]></category>
		<category><![CDATA[as3 flash art]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/2011/08/29/perlin-lines-a-beautiful-art-effect-in-as3-flash/</guid>
		<description><![CDATA[Really awesome generative art from flashandmath http://tpt.to/agn5D8]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; margin-right: auto; margin-left: auto;" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/08/wpid-lines4.jpeg" alt="image" /></p>
<p>Really awesome generative art from flashandmath <a href="http://tpt.to/agn5D8">http://tpt.to/agn5D8</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/08/29/perlin-lines-a-beautiful-art-effect-in-as3-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing LazyFallback 2</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/08/20/announcing-lazyfallback-2/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/08/20/announcing-lazyfallback-2/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 00:24:21 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[banner ads]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[fallback]]></category>
		<category><![CDATA[lazyfallback]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=601</guid>
		<description><![CDATA[Batch banner ad fallback generator for devs who work smarter, not harder! &#160; Around 8 months ago, I released LazyFallback, the batch jpg fallback generator for flash. That version was hacked together over just a few hours on the train [...]]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.oyvindnordhagen.com/lazyfallback"><img class="alignright size-medium wp-image-602" title="Screen Shot 2011-08-20 at 01.53.51" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/08/Screen-Shot-2011-08-20-at-01.53.51-242x300.png" alt="" width="242" height="300" /></a><em>Batch banner ad fallback generator for devs who work smarter, not harder!</em></h3>
<p>&nbsp;</p>
<p>Around 8 months ago, I released LazyFallback, the batch jpg fallback generator for flash. That version was hacked together over just a few hours on the train to and from work and had a few obvious limitations. Especially when it came to movies with scripted animation.</p>
<p>This time, I&#8217;ve done it right (I think). Funnily enough, during the time I was working on improving LazyFallback, I talked to <a href="http://twitter.com/#!/paulholliday">@paulholliday</a> who by sheer coincidence was working on the exact same thing, and he kindly let me have the source for his own app, <a href="http://blog.mediafront.no/2011/03/07/fallback-creator/">FallbackCreator</a>. Inspired by his solution, I changed the solution for loading the swfs altogether from using a Loader to using AIR&#8217;s HTMLLoader to enable AVM1 movies to play as naturally as possible.</p>
<h3>Other improvements:</h3>
<ul>
<li>Much better memory handling</li>
<li>AutoUpdate</li>
<li>Graceful error handling</li>
<li>Slightly more polished UI</li>
<li>New icons</li>
</ul>
<p>Also, this has been a trial project for <a href="http://www.robotlegs.org/">Robotlegs</a> on my part, which I really like. But personally, I&#8217;m not too font of Flex data binding, so I combined it with<a href="http://www.oyvindnordhagen.com/blog/2011/02/28/introducing-bindlite/">BindLite</a> (or more specifically a new version called BindMax, which I might publish later).</p>
<h3>A word of caution</h3>
<p>Your swfs should not contain playing MovieClips or ActionScript on the first frame. This is a good practice in genereal when it comes to banners ads either way, but for LazyFallback to be able to reliably control the capture delay, nothing should <em>happen</em> before frame 2.</p>
<p>So why wait—<a href="http://www.oyvindnordhagen.com/lazyfallback">go get LazyFallback now</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/08/20/announcing-lazyfallback-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR NativeDragDrop gotcha</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/07/14/air-nativedragdrop-gotcha/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/07/14/air-nativedragdrop-gotcha/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 12:22:59 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[drag]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[nativedragdrop]]></category>
		<category><![CDATA[nativedragdropevent]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=593</guid>
		<description><![CDATA[While performing some refactorings to LazyFallback, I came across a small gotcha with the sequence of the drag and drop implementation in Adobe AIR. It seems that dropping files will trigger a NativeDragEvent.NATIVE_DRAG_EXIT just before the NativeDragEvent.NATIVE_DRAG_DROP fires. This might not be [...]]]></description>
			<content:encoded><![CDATA[<p>While performing some refactorings to LazyFallback, I came across a small gotcha with the sequence of the drag and drop implementation in Adobe AIR. It seems that dropping files will trigger a NativeDragEvent.NATIVE_DRAG_EXIT just before the NativeDragEvent.NATIVE_DRAG_DROP fires. This might not be a problem if all you use the NATIVE_DRAG_EXIT event for is to update some visuals. I my case however, I was also clearing the file list to be processed, which lead me to spot the problem.</p>
<p>Here&#8217;s an example class:</p>
<pre lang="actionscript">public class DropTest {
   private var fileQue:Array;
   private var dropWell:Sprite;

   public function DropTest () {
      dropWell.addEventListener( NativeDragEvent.NATIVE_DRAG_ENTER, dragEnterhandler );
      dropWell.addEventListener( NativeDragEvent.NATIVE_DRAG_DROP, dropHandler );
      dropWell.addEventListener( NativeDragEvent.NATIVE_DRAG_EXIT, dragExitHandler );
   }

   private function dragEnterhandler ( event:NativeDragEvent ):void {
      var files:Array = event.clipboard.getData( ClipboardFormats.FILE_LIST_FORMAT ) as Array;
      if (files &#038;&#038; files.length) queFiles( files );
      else queFiles( null );
   }

   private function queFiles ( files:Array ):void {
      fileQue = files;
      if (files) {
         NativeDragManager.acceptDragDrop(dropWell);
         // Update visuals
      }
      else {
         // Update visuals
      }
   }
   private function dragExitHandler ( event:NativeDragEvent ):void {
      // This event handler will be called before dropHandler when dropping files
      queFiles( null );
   }

   private function dropHandler ( event:NativeDragEvent ):void {
      for each (var file:File in fileQue) {
         processFile( file ); // Fails because dragExitHandler has nulled fileQue
      }
   }
}
</pre>
<p>My suggestion for a solution to this is that you assign responsibilities for the event handlers as follows:</p>
<ul>
<li><strong>NativeDragEvent.NATIVE_DRAG_ENTER:</strong> Validate files and update visuals</li>
<li><strong>NativeDragEvent.NATIVE_DRAG_DROP</strong>: Que files and start processsing</li>
<li><strong>NativeDragEvent.NATIVE_DRAG_EXIT:</strong> Update visuals</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/07/14/air-nativedragdrop-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A moment of gratitude</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/03/23/a-moment-of-gratitude/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/03/23/a-moment-of-gratitude/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 22:47:03 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[campaign]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=586</guid>
		<description><![CDATA[I&#8217;d like to show my appreciation for the people I work with for a moment. A little background Two weeks ago — together with several other contributors at Apt, Try and Paradox— I finished a three week long project for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to show my appreciation for the people I work with for a moment.</p>
<h3>A little background</h3>
<p>Two weeks ago — together with several other contributors at <a href="http://www.apt.no" target="_blank">Apt</a>, <a href="http://www.try.no" target="_blank">Try</a> and <a href="http://www.paradox.no" target="_blank">Paradox</a>— I finished a three week long project for the Norwegian Department of Education. It&#8217;s a campaign website which aims to encourage people aged 18-24 to become teachers. The site is at <a href="http://www.www.hardudetideg.no/fremtiden/" target="_blank">www.hardudetideg.no/fremtiden</a> (Norwegian) and it lets you place yourself or a friend as the main subject of a movie filmed in year 2069 about people looking back at their time in school, reminiscing about a teacher who changed their lives for the better. We incorporated run time motion tracking, grading and audio substitution to make it possible and it was a great learning experience for me.</p>
<p>The site has performed very well with 57 569 visits and around 15 000 produced movies over two weeks. In addition to that we seem to have hit the nail on the head demographically, with the majority of the Facebook users right smack down on the target group:</p>
<p><a href="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/03/Skjermbilde-2011-03-23-kl.-21.11.54.png" rel="lightbox[586]"><img class="alignnone size-full wp-image-587" title="HDDID demographic" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/03/Skjermbilde-2011-03-23-kl.-21.11.54.png" alt="" width="715" height="218" /></a></p>
<p>We have good numbers for feedback per share and average time on site as well. But while the response to the site has been overwhelming, what matters most to me is that there is nothing but praise to find when looking up referring sites and Facebook posts about the campaign and today even the Prime Minister of Norway chipped in:</p>
<p><a href="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/03/Skjermbilde-2011-03-23-kl.-20.44.00.png" rel="lightbox[586]"><img class="alignnone size-full wp-image-588" title="Jens Stoltenber anbefaler" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2011/03/Skjermbilde-2011-03-23-kl.-20.44.00.png" alt="" width="485" height="191" /></a></p>
<h3>The thanking part</h3>
<p>I begun working at <a href="http://www.apt.no" target="_blank">Apt</a> this January and this is my project number four since then. It only shows what is possible in a skilled environment with jelled teams and proper project management. These are scarce luxuries that I have had to live without so far in my life.</p>
<p>I was fortunate to be the lead developer and I worked days and nights on this. But I only did the Flash development, and there were many others involved that did an outstanding job. Knowing how lucky I am to work with such awesome people, I feel compelled to give them credit in the best way I know.</p>
<ul>
<li><strong><a href="http://www.paradox.no" target="_blank">Paradox</a>:</strong> They put together the team that shot, edited and mastered the film. This was no small task, with 30 people on set. I don&#8217;t know all of their names, but they all get at big hug from me. The names I know are Stefan Faldbakken (director) and Beate Tangre (producer).</li>
<li><strong>Knut Skåla:</strong> One of my colleagues at Apt who served as sort of a helper developer but in reality saved my ass on numerous occations because he knows so much more about Apt&#8217;s AS3 framework and the Facebook API than I do.</li>
<li><strong>Thomas Sømoen:</strong> Backend developer at Apt who shared the vision also worked late nights to make the deadline.</li>
<li><strong>Stina Norgren:</strong> Designer at Apt, the one who came up with the UI and the nice 3D touch to the interface. When I first saw her designs, I got really excited about making it work they way she had intended.</li>
<li><strong>Linda Tillier and Fred Khile:</strong> Project manager and consultant at Apt. People like these rarely get the credit they deserve, but the fact of the matter is that they have kept everything else in check, enabling me to keep my eye on the ball and only concern myself with the stuff that affects my part of the job. When I am surprised because great material for me to use simply arrives in my inbox before I have asked for it because someone else is taking pride in their job, these are the people to thank for that.</li>
<li><strong>Christian Pettersen:</strong> Compositor and effects engineer at Apt who also gave more than a days effort to deliver on this project. He kept the external production in alignment with the internal development and was an invaluable wizard when it comes to providing tracking data and retouching the movie for web delivery.</li>
</ul>
<p>I&#8217;m priveleged to work in an agency that values the effort an collaboration of people like these so thank you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/03/23/a-moment-of-gratitude/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

