<?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 &#187; Problems &amp; Solutions</title>
	<atom:link href="http://www.oyvindnordhagen.com/blog/category/flash/problems-solutions/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>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>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>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>Introducing BindLite</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/02/28/introducing-bindlite/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/02/28/introducing-bindlite/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 23:52:27 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[BindLite]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[alternative]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[bindable]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[bindlite]]></category>
		<category><![CDATA[data]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=576</guid>
		<description><![CDATA[BindLite is a lightweight, flex-less data binding alternative for AS3 applications. The reason I created it is to avoid including the flex.swc in my applications and to get a cleaner, more efficient syntax for data binding with better performance than the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/blog/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>BindLite is a lightweight, flex-less data binding alternative for AS3 applications. The reason I created it is to avoid including the flex.swc in my applications and to get a cleaner, more efficient syntax for data binding with better performance than the [Bindable] meta tag.</p>
<p>It is currently at version 0.9 for obvious reasons; I would like to hear from you about what you think, whether it works for you and if there are features it lacks. I have already tested it on two small projects and it has worked very well for me.</p>
<ul>
<li>Visit the <a href="http://www.oyvindnordhagen.com/blog/bindlite/">project page</a> for more info</li>
<li>Visit the <a href="http://code.google.com/p/bindlite/">Google Code page</a></li>
<li>Download <a href="http://code.google.com/p/bindlite/downloads/detail?name=BindLite_0.9.0.5.zip">the zip</a></li>
<li>Read <a href="http://www.oyvindnordhagen.com/bindlite/docs/">the docs</a></li>
<li>Give me <a href="http://twitter.com/nordhagen">feedback</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/02/28/introducing-bindlite/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LazyFallback 1.1</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/01/29/lazyfallback-1-1/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/01/29/lazyfallback-1-1/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 20:27:24 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[1.1]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[fallback]]></category>
		<category><![CDATA[jpgs]]></category>
		<category><![CDATA[lazyfallback]]></category>
		<category><![CDATA[render]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=558</guid>
		<description><![CDATA[Two things turned out to be incomplete about LazyFallback when I released it yesterday: All fallbacks were rendered on a white background. After some fumbling with the bits, the app now reads the background color specified at compile time. The [...]]]></description>
			<content:encoded><![CDATA[<p>Two things turned out to be incomplete about LazyFallback when I released it yesterday:</p>
<ul>
<li>All fallbacks were rendered on a white background. After some fumbling with the bits, the app now reads the background color specified at compile time.</li>
<li>The drop well would accept any number of files as long as at least one of them was a swf. However, it would also attempt to render fallbacks for non-swf files. The file list is now sanitized so that only swf files are parsed.</li>
</ul>
<p><a href="http://www.oyvindnordhagen.com/lazyfallback/">Get it here!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/01/29/lazyfallback-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing LazyFallback</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/01/29/introducing-lazyfallback/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/01/29/introducing-lazyfallback/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 23:38:04 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[ad]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[banner]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[fallback]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[generate]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=553</guid>
		<description><![CDATA[LayzyFallback is a free utility app that batch generates fallback JPGs from you banner ad SWF files with a simple drag and drop interface. I made it over a few hours today and in fact it has already saved me [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/lazyfallback"><img class="alignright size-medium wp-image-551" title="LazyFallback" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2009/05/Skjermbilde-2011-01-29-kl.-00.19.25-268x300.png" alt="" width="268" height="300" /></a>LayzyFallback is a free utility app that batch generates fallback JPGs from you banner ad SWF files with a simple drag and drop interface. I made it over a few hours today and in fact it has already saved me time having to re-create fallbacks for 60 SWFs after the client decided that their logo had to be a tad bigger.</p>
<p>It sports a small, single window interface with a well for dropping SWF files on and three controls at the bottom. These allow you to choose the frame used for the rendered JPG, the JPG quality and there&#8217;s an option to make LazyFallback actually play each frame from the SWF leading up to the frame you specify, in case you have timeline scripts and scripted timing that needs to run.</p>
<p>I&#8217;ve also created a &#8220;Free Utils&#8221; page to hold a page for this app and another one that&#8217;s currently in the making. Maybe there will be more of them in time.</p>
<p>As noted, the idea for this app was concieved only hours ago, so it is not very thoroughly tested. In fact I&#8217;ve just tested installing it, running it and using it in my own Mac environment, so any comments on mileage variations is apprechiated. This is also the first completed AIR app I&#8217;ve written and released, so I&#8217;ll be humble if it turns out it has flaws. But nonetheless, writing it was great fun! I got to try native drag and drop, file system access, the FDT AIR packager, certificate generation and <a href="http://minimalcomps.com/" target="_blank">minimal comps</a> by <a href="http://www.bit-101.com/blog/" target="_blank">Keith Peters</a>, all for the first time.</p>
<p>It&#8217;s free so I don&#8217;t expect anything from you, but if you like it, it&#8217;d be <a href="http://twitter.com/nordhagen">nice to hear it</a> <img src='http://www.oyvindnordhagen.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/01/29/introducing-lazyfallback/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Compile SWC fast and easy with compc</title>
		<link>http://www.oyvindnordhagen.com/blog/2011/01/18/compile-swc-fast-and-easy-with-compc/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2011/01/18/compile-swc-fast-and-easy-with-compc/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 21:57:19 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[compc]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[libs]]></category>
		<category><![CDATA[swc]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=533</guid>
		<description><![CDATA[I&#8217;m not a command line pro. I make my way around it when I have to, but it usually takes some trial and error. Today I got fed up over having to set up projects in FDT/Flash Builder only to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not a command line pro. I make my way around it when I have to, but it usually takes some trial and error. Today I got fed up over having to set up projects in FDT/Flash Builder only to compile a SWC from some external library. So I decided it was time to learn how to do it with compc, the command line library compiler, and then write it down as a template I could use over and over. Here&#8217;s the recipe it five easy steps.</p>
<ol>
<li>Open Terminal or whatever command line pertains to your system.</li>
<li>Use the &#8220;cd&#8221; command to navigate to the &#8220;bin&#8221; folder in the SDK folder you wish to use. In my case the complete command is &#8220;cd /Users/nord/as3/sdks/4.0.0/bin&#8221;</li>
<li>Paste the stuff below into a text editor that supports Regular Expressions (e.g. <a href="http://macromates.com/">TextMate</a>).</li>
<li>Replace all the paths based on the comments and run search/replace with this pattern: \[.+\]|\r|\n|\t (replace with nothing). This removes the comments and line breaks and creates a complete, but harder to read command that can be pasted into the command line.</li>
<li>Select all, copy, paste in the command line, press enter and you are done!.</li>
</ol>
<p></p>
<pre lang="shell">bash compc
[Define SDK root folder + /frameworks here]
 -framework=
	/Users/nord/as3/sdks/4.0.0/frameworks
[Define target player]
 -target-player=
	10.0
[Debug false when creating libraries]
 -compiler.debug=
	false
[All referenced source folders]
 -source-path=
	/Users/nord/as3/libs/nordhagen/src/,
	/Users/nord/as3/libs/SWFAddress/2.4
[All referenced source SWCs]
 -library-path=
	/Users/nord/as3/sdks/4.0.0/frameworks/libs/player/10.0/playerglobal.swc,
	/Users/nord/as3/sdks/4.0.0/frameworks/libs/flex.swc,
	/Users/nord/as3/libs/Olog2/swc/Olog.swc,
	/Users/nord/as3/libs/TweenLite/greensock.swc,
[Only these sources are actually compiled]
 -include-sources=
	/Users/nord/as3/libs/nordhagen/src
[Path and file name to resulting SWC file]
 -output=
	/Users/nord/as3/libs/nordhagen/bin/nordhagen.swc</pre>
<h3>Notes</h3>
<ul>
<li><strong>-source-path</strong> and <strong>-library-path</strong> are source folders and swc files respectively. There is no special treatment for external/linked libraries. This actually confused me a little at first because the project&#8217;s main source folder and it&#8217;s external dependencies are treated so differently in most IDEs, but here they are equal. This is where you tell the compiler what folders/SWCs it needs to be aware of so to speak. At this point, these paths are solely used for compiler validation, they are not included in the SWC unless you also list them under&#8230;</li>
<li><strong>-include-sources </strong>is the list of source folders among those listed under -source-path/-library-path that should be <em>included</em> in the compiled SWC.</li>
<li>Note that it you decide to format the command without the supplied RegEx, you need to make sure that the paths are separated only by the comma. No spaces!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2011/01/18/compile-swc-fast-and-easy-with-compc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing properties by reference in ActionScript 3</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/11/11/passing-properties-by-reference-in-actionscript-3/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/11/11/passing-properties-by-reference-in-actionscript-3/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 23:50:23 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[propery]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=480</guid>
		<description><![CDATA[@DavidArno asked on Twitter: That&#8217;s actually a good question. But it seems there&#8217;s no way to force a property to be passed by reference in AS3. The behaviour of most properties are to be passed by value, which means that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/#!/DavidArno" target="_blank">@DavidArno</a> asked on Twitter:</p>
<p><a href="http://twitter.com/#!/DavidArno"><img class="alignnone size-full wp-image-481" title="Skjermbilde 2010-11-11 kl. 00.09.27" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/11/Skjermbilde-2010-11-11-kl.-00.09.27.png" alt="" width="429" height="175" /></a></p>
<p>That&#8217;s actually a good question. But it seems there&#8217;s no way to force a property to be passed by reference in AS3. The behaviour of most properties are to be passed by value, which means that if you write this:</p>
<pre lang="actionscript">
var myValue:String = _myObject.value;
</pre>
<p>Then the value of _myObject.value is copied into the value of myValue and not further connection between the two is maintained. There are exceptions to this rule, Arrays being one of them. But in general this is how it works.</p>
<p>But sometimes you want myValue to continuously reflect the value of _myObject.value. Or maybe if you wanted another object to have access to the original object&#8217;s value, you would have to pass boh a reference to the object and the property name as a string. You would have to get a little dirty and use the AS3 equivalent of the old eval() function in AS2. In AS3, we do this with a string representation of the property name enclosed in square brackets, like so:</p>
<pre lang="actionscript">
var myValue:String = _myObject["value"];
</pre>
<p>As we know, eval is evil because it&#8217;s slower and more error prone than accessing the property directly. Hence we need an elegant workaround that at the very least looks like we&#8217;ve made an attempt to formalize the situation. So I created a small example class.</p>
<pre lang="actionscript">
package
{
	public class PropertyReference
	{
		private var _object:Object;
		private var _property:String;

		public function PropertyReference(object:Object, property:String):void
		{
			_object = object;
			_property = property;
		}

		public function get value():*
		{
			return _object[_property];
		}

		public function set value(val:*):void
		{
			_object[_property] = val;
		}
	}
}
</pre>
<p>As you see, all it does is store a reference to the object instance containing the property and the name of the property. It also contains getters and setters for hiding the grunt work of accessing and motifying the property. It does not help the speed issue, but it makes it less error prone. You would instantiate it like this:</p>
<pre lang="actionscript">
var propertyRef:PropertyReference = new PropertyReference(_myObject, "value");
</pre>
<p>That means you only specify the string equivalent of the property name once, which makes it less error prone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/11/11/passing-properties-by-reference-in-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freebie: ClickTag AS3</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/10/20/clicktag-as3/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/10/20/clicktag-as3/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 23:31:40 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[ads]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[banner]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[clicktag]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[freebie]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=473</guid>
		<description><![CDATA[Just thought i&#8217;d share this class I made for doing ClickTag banner ads with AS3. It will get the clickTag url form root.loaderInfo. It will also use window.open for compability reasons with IE7 ans Firefox and it will also do [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/10/clicktagas3.jpg" rel="lightbox[473]"><img class="alignnone size-full wp-image-474" title="ClickTag as3" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/10/clicktagas3.jpg" alt="" width="565" height="176" /></a></p>
<p>Just thought i&#8217;d share this class I made for doing ClickTag banner ads with AS3. It will get the clickTag url form root.loaderInfo. It will also use window.open for compability reasons with IE7 ans Firefox and it will also do logging so the website that will host it can tell if the clickTag is being read in correctly or not.</p>
<p>Here it is:</p>
<p><a href="http://www.oyvindnordhagen.com/public/ClickTag.as"><img class="alignnone size-full wp-image-475" title="Download" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/10/asicon.jpg" alt="" width="32" height="33" /></a> <a href="http://www.oyvindnordhagen.com/public/ClickTag.as">ClickTag.as</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/10/20/clicktag-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

