<?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>Flassari.is &#187; Flash</title>
	<atom:link href="http://flassari.is/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://flassari.is</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 08:17:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Showing static variables in the Flash Builder 4.5 debugger</title>
		<link>http://flassari.is/2012/01/showing-static-variables-in-the-flash-builder-4-5-debugger/</link>
		<comments>http://flassari.is/2012/01/showing-static-variables-in-the-flash-builder-4-5-debugger/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 08:15:16 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=472</guid>
		<description><![CDATA[For some reason this option is turned off by default. To see the static variables of your classes, simply click the small down-facing triangle on the top-right of the variables panel, and click Flex->Show Static Variables.]]></description>
			<content:encoded><![CDATA[<p>For some reason this option is turned off by default.<br />
To see the static variables of your classes, simply click the small down-facing triangle on the top-right of the variables panel, and click Flex->Show Static Variables.</p>
<p><img src="http://flassari.is/wp-content/uploads/2012/01/Static.png" alt="Show static variables in Flash Builder" title="Show static variables in Flash Builder" width="433" height="175" class="alignnone size-full wp-image-473" /></p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2012/01/showing-static-variables-in-the-flash-builder-4-5-debugger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Angry Birds coming to Facebook</title>
		<link>http://flassari.is/2012/01/angry-birds-coming-to-facebook/</link>
		<comments>http://flassari.is/2012/01/angry-birds-coming-to-facebook/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 17:53:44 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[angry birds]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[rovio]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=463</guid>
		<description><![CDATA[Finally, I&#8217;ve been working as a Senior Developer on the Angry Birds facebook game for a few months now, and its been announced! Rovio has created an official facebook event at http://www.facebook.com/events/174654275973227/. After the workload decreases I should be able to start writing again, I have some PureMVC stuff I&#8217;m dying to write about.]]></description>
			<content:encoded><![CDATA[<p>Finally, I&#8217;ve been working as a Senior Developer on the Angry Birds facebook game for a few months now, and its been announced!<br />
Rovio has created an official facebook event at <a href="http://www.facebook.com/events/174654275973227/">http://www.facebook.com/events/174654275973227/</a>.</p>
<p><img src="http://flassari.is/wp-content/uploads/2012/01/AngryBirdsFacebook.jpg" alt="Angry Birds on Facebook" title="Angry Birds on Facebook" width="180" height="180" class="alignnone size-full wp-image-466" /></p>
<p>After the workload decreases I should be able to start writing again, I have some PureMVC stuff I&#8217;m dying to write about.</p>
<p><iframe width="450" height="259" src="http://www.youtube.com/embed/qS0NQ3CtKhg" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2012/01/angry-birds-coming-to-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error #3692: All buffers need to be cleared every frame before drawing</title>
		<link>http://flassari.is/2011/11/error-3692-all-buffers-need-to-be-cleared-every-frame-before-drawing/</link>
		<comments>http://flassari.is/2011/11/error-3692-all-buffers-need-to-be-cleared-every-frame-before-drawing/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 09:12:26 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[3692]]></category>
		<category><![CDATA[bitmap]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[buffers]]></category>
		<category><![CDATA[context3d]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[Starling]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=457</guid>
		<description><![CDATA[So I have this Starling project and wanted to take a screenshot of the Stage3D currently in use. I was trying to use the Context3D.drawToBitmapData() function and kept getting this error: &#8220;Error #3692: All buffers need to be cleared every frame before drawing.&#8221; Googling around yielded no results, so after figuring out the problem I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>So I have this Starling project and wanted to take a screenshot of the Stage3D currently in use.<br />
I was trying to use the Context3D.drawToBitmapData() function and kept getting this error:<br />
&#8220;Error #3692: All buffers need to be cleared every frame before drawing.&#8221;</p>
<p>Googling around yielded no results, so after figuring out the problem I&#8217;m posting the solution here for anyone else having this problem.</p>
<p>The solution is short: you have to call drawToBitmapData() BEFORE the Context3D.present() call.</p>
<p>In my case with Starling I had to add the functionality in the Starling.render() function, between the call to mStage.render() and the call to mContext.present().</p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2011/11/error-3692-all-buffers-need-to-be-cleared-every-frame-before-drawing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mxmlc ANT compiler error: &#8220;Error: Java heap space&#8221;</title>
		<link>http://flassari.is/2011/09/mxmlc-ant-compiler-error-error-java-heap-space/</link>
		<comments>http://flassari.is/2011/09/mxmlc-ant-compiler-error-error-java-heap-space/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 12:34:08 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[ANT]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ANT_OPTS]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java heap space]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[maxmemory]]></category>
		<category><![CDATA[mxmlc]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=441</guid>
		<description><![CDATA[A simple error that causes a lot of headache that has a simple solution that is hard to find on the internet. Don&#8217;t you just love these problems? If you are calling mxmlc via ANT you&#8217;ve probably seen this error and had to resort to solutions like setting the ANT_OPTS or Java arguments for the [...]]]></description>
			<content:encoded><![CDATA[<p>A simple error that causes a lot of headache that has a simple solution that is hard to find on the internet.<br />
Don&#8217;t you just love these problems?</p>
<p>If you are calling mxmlc via ANT you&#8217;ve probably seen this error and had to resort to solutions like setting the ANT_OPTS or Java arguments for the SDK on every single computer that uses that build script.</p>
<p>The solution is actually much simpler than that, mxmlc allows you to set this in the ANT target itself. Just add the parameters fork=&#8221;true&#8221; to make it run on it&#8217;s own Java thread, and then set maxmemory to something like &#8220;1024m&#8221;.</p>
<pre class="brush: as3"><mxmlc
	file="Main.as"
	output="Output.swf"
	fork="true"
	maxmemory="1024m"
>
	<!-- Other configurations -->
</mxmlc></pre>
<p>It would have been nice if adobe had this in the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html">documentation</a>, but no such luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2011/09/mxmlc-ant-compiler-error-error-java-heap-space/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 Polygon Clipper</title>
		<link>http://flassari.is/2011/05/as3-polygon-clipper/</link>
		<comments>http://flassari.is/2011/05/as3-polygon-clipper/#comments</comments>
		<pubDate>Mon, 23 May 2011 09:00:35 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[alchemy]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[clip]]></category>
		<category><![CDATA[clipper]]></category>
		<category><![CDATA[clipping]]></category>
		<category><![CDATA[commercial]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[GPC]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[polygon]]></category>
		<category><![CDATA[polygon boolean operation]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[subtract]]></category>
		<category><![CDATA[swc]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=408</guid>
		<description><![CDATA[I was looking for an open source polygon clipper library for AS3 to use on a commercial project. I found a few ports of the General Polygon Clipper library (GPC) but it is only free for non-commercial projects. After more searching around I found this excellent library called Clipper by Angus Johnson. It did not [...]]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://flassari.is/wp-content/uploads/2011/05/A-B.png" title="Polygon Clipper" /></center><br />
I was looking for an open source polygon clipper library for AS3 to use on a commercial project.<br />
I found a <a href="http://code.google.com/p/gpcas/">few</a> <a href="http://code.google.com/p/polygonal/wiki/GeneralPolygonClipperAlgorithm">ports</a> of the General Polygon Clipper library (<a href="http://www.cs.man.ac.uk/~toby/alan/software/">GPC</a>) but it is <a href="http://www.cs.man.ac.uk/~toby/alan/software/#Licensing">only free for non-commercial projects</a>.<br />
After more searching around I found this excellent library called <a href="http://www.angusj.com/delphi/clipper.php">Clipper by Angus Johnson</a>. It did not have an AS3 port so I made one using <a href="http://labs.adobe.com/technologies/alchemy/">Alchemy</a> to wrap the c++ code.</p>
<p>The SWC and source code can be found on github: <a href="https://github.com/Flassari/as3clipper">https://github.com/Flassari/as3clipper</a></p>
<p>It is completely free and open source for both personal and commercial projects. Clipper uses the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License</a>.</p>
<p>Supported clipping operations: difference, intersection, union and XOR.</p>
<p>Here&#8217;s an example of how to use the AS3 port after importing the Clipper.swc file:</p>
<pre class="brush:as3">import com.flassari.geom.Clipper;
import com.flassari.geom.ClipType;

var subjectPolygon:Array = [new Point(0, 0), new Point(200, 0), new Point(100, 200)];

var clipPolygon:Array = [new Point(0, 100), new Point(200, 100), new Point(300, 200)];

var resultPolygons:Array = Clipper.clipPolygon(subjectPolygon, clipPolygon, ClipType.DIFFERENCE);</pre>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2011/05/as3-polygon-clipper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Prefixing private variables with an underscore in AS3</title>
		<link>http://flassari.is/2011/04/prefixing-private-variables-with-an-underscore-in-as3/</link>
		<comments>http://flassari.is/2011/04/prefixing-private-variables-with-an-underscore-in-as3/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 19:00:03 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding conventions]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[getter]]></category>
		<category><![CDATA[prefix]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[rule]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[setter]]></category>
		<category><![CDATA[standard]]></category>
		<category><![CDATA[underscore]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=383</guid>
		<description><![CDATA[A coworker and I had a discussion about using underscores for private variables in AS3. I&#8217;ve always added an underscore before my private variables, like so: private var _myVariable:int; While he wanted to only use underscores for when you have a variable which has a getter/setter: private var _myGetAndOrSetVariable:int; private var myPrivateVariable:int; public function get [...]]]></description>
			<content:encoded><![CDATA[<p>A coworker and I had a discussion about using underscores for private variables in AS3.<br />
I&#8217;ve always added an underscore before my private variables, like so:</p>
<pre class="brush:as3">private var _myVariable:int;</pre>
<p>While he wanted to only use underscores for when you have a variable which has a getter/setter:</p>
<pre class="brush:as3">private var _myGetAndOrSetVariable:int;
private var myPrivateVariable:int;

public function get myGetAndOrSetVariable():int {
	return _myGetAndOrSetVariable;
}</pre>
<p>This was a little alien to me and I didn&#8217;t get the point of it. Why should you only sometimes use an underscore? He answered that then you know that private variable has a getter/setter if it has an underscore.</p>
<p>Well, that&#8217;s not a bad reason. I googled around and it sounds like Adobe actually enforces this kind of rule in their <a href="http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Storagevariablenames" target="_blank">Coding Conventions document</a>; &#8220;Give the storage variable for the getter/setter foo the name _foo.&#8221;.<br />
They don&#8217;t say anything about if the other variables shouldn&#8217;t have underscores though, so I dived into the source code of the Flex SDK to see what they were using.<br />
Turns out, both! In some classes every single private variable had an underscore, and in other ones only variables with a public getter/setter had one.<br />
In <a href="http://active.tutsplus.com/articles/open-mike/open-mike-prefixes/">this poll</a>, majority of AS3 developers always use underscores.</p>
<p>I thought long and hard, and I came up with these reasons for why one should always use underscores for private variables:</p>
<ul style="list-style-type:disc">
<li>It can be confusing &#8220;sometimes and sometimes not&#8221; putting an underscore.</li>
<li>You can see immediately if the variable is accessible to another class when you always prefix private variables with underscores.</li>
<li>Most of the in-house code and frameworks always use underscores (consistency).</li>
<li>Pressing ctrl+space for IDE code completion shows you all the local private variables if you type an underscore first, if you don&#8217;t you get every single variable in the class with every class in the project together in one gigantic list.</li>
<li><a href="http://active.tutsplus.com/articles/open-mike/open-mike-prefixes/">Most other coders</a> and their frameworks online use it.</li>
<li>If you are going to create a getter/setter for the variable, you have to rename it first to include the underscore.</li>
<ul style="list-style-type:circle">
<li>Also, if you rename it without refactoring, all references in the class will now pull from the getter (possible calling extra code) when maybe they were only supposed to get the raw data.</li>
</ul>
<li>If the other method is used I will know much less about the variable just from looking at it, possible making debugging harder. It could be a local variable, a class function, a function parameter, a private variable without a getter/setter, a getter/setter function or a public variable.</li>
</ul>
<p>Personally, I don&#8217;t really care when I&#8217;m writing code in a class if a variable has a getter/setter. That&#8217;s encapsulation, and I think mostly of it when working in/thinking of other classes that interact with the current one. I much more care knowing if I&#8217;m working with a variable or calling a getter function (it could be a public variable too, but still less complicated).<br />
I also prefer to write &#8220;_id = id&#8221; instead of &#8220;this.id = id&#8221;.</p>
<p>Also, adding an underscore just to avoid a name conflict doesn&#8217;t sound proper to me. It sounds like you had to make a workaround to make the code do what you want (read: a shit mix).</p>
<p>So far these are enough reasons for me to stick with prefixing my private variables with underscores. I have an open mind though, a comment can easily change my mind if it has the right arguments.</p>
<p>What is your method, and why? Please do share =)</p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2011/04/prefixing-private-variables-with-an-underscore-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Populating a Vector in the constructor</title>
		<link>http://flassari.is/2011/01/populating-a-vector-in-the-constructor/</link>
		<comments>http://flassari.is/2011/01/populating-a-vector-in-the-constructor/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 15:12:34 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[populate vector]]></category>
		<category><![CDATA[Vector]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=380</guid>
		<description><![CDATA[There is a small difference between populating a Vector while instancing it and an Array. While an Array is instanced this way: var names:Array = ["Bob", "Larry", "Sarah"]; a Vector can be instanced like this: // In the constructor var names:Vector.&#60;String> = new &#60;String>["Bob", "Larry", "Sarah"]; // Converting from a regular Array using the Vector [...]]]></description>
			<content:encoded><![CDATA[<p>There is a small difference between populating a Vector while instancing it and an Array.<br />
While an Array is instanced this way:</p>
<pre class="brush: as3">var names:Array = ["Bob", "Larry", "Sarah"];</pre>
<p>a Vector can be instanced like this:</p>
<pre class="brush: as3">// In the constructor
var names:Vector.&lt;String> = new &lt;String>["Bob", "Larry", "Sarah"];
// Converting from a regular Array using the Vector global (about three times slower)
var names:Vector.&lt;String> = Vector.&lt;String>(["Bob", "Larry", "Sarah"]);</pre>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2011/01/populating-a-vector-in-the-constructor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preloader without a loader-swf in AS3</title>
		<link>http://flassari.is/2010/11/preloader-without-a-loader-swf-in-as3/</link>
		<comments>http://flassari.is/2010/11/preloader-without-a-loader-swf-in-as3/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 16:08:26 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[factory]]></category>
		<category><![CDATA[factoryclass]]></category>
		<category><![CDATA[flex sdk]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[loader-swf]]></category>
		<category><![CDATA[preloader]]></category>
		<category><![CDATA[single swf]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=359</guid>
		<description><![CDATA[Here&#8217;s one method of loading your AS3 movie, using a preloader class that loads before all other classes. The flex compiler can actually split up the code for you so one class loads before all others. Even though we&#8217;re using the flex compiler to do this we do not have to have a Flex project, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one method of loading your AS3 movie, using a preloader class that loads before all other classes.</p>
<p>The flex compiler can actually split up the code for you so one class loads before all others. Even though we&#8217;re using the flex compiler to do this we do not have to have a Flex project, it can be a Flash project or a pure actionscript project. If we&#8217;re using a Flash project we do have to set the flex compiler path though.</p>
<p>Anyways, the way it works is that in your main class you add the Frame metadata, like this:</p>
<pre class="brush:as3">package com.flassari {
// Preloader meta tag
[Frame(factoryClass="com.flassari.Preloader")]
// Start of our own application code
[SWF(backgroundColor="#FFFFFF", frameRate="24", width="800", height="600", pageTitle="My preloaded project")]
public class Main extends Sprite
{</pre>
<p>The preloader has to extend movieClip, because behind the scenes it is using frames for its magic.<br />
In your preloader class, when it is done loading (by checking if it is at the last frame), your have to instantiate the main class with no strict typing. If you were to use strict typing, the whole application would have to load before the preloader can be shown so that would defeat the purpose of a preloader:</p>
<pre class="brush:as3">private function onEnterFrame(e:Event):void {
	if (currentFrame == totalFrames) { // If we're at the frame where Main is ready
		// Stop and clean up
		stop();
		removeEventListener(Event.ENTER_FRAME, onEnterFrame);
		// Create the main application and add it to the display list
		var mainClass:Class = getDefinitionByName("com.flassari.Main") as Class;
		addChild(new mainClass() as DisplayObject);
	}
}</pre>
<p>Just remember, everything that the preloader references will be loaded before the preloader can be shown, so keep it to a minimum.<br />
Also, because the main class is created before it is put on the stage, be sure not to reference the stage in the constructor.</p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2010/11/preloader-without-a-loader-swf-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The OR ( &#124;&#124; ) operator in AS3</title>
		<link>http://flassari.is/2010/09/the-or-operator-in-as3/</link>
		<comments>http://flassari.is/2010/09/the-or-operator-in-as3/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 12:45:54 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[conditials]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[NaN]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[operator]]></category>
		<category><![CDATA[or]]></category>
		<category><![CDATA[or operator]]></category>
		<category><![CDATA[undefined]]></category>
		<category><![CDATA[value]]></category>
		<category><![CDATA[||]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=351</guid>
		<description><![CDATA[Here's a quick tip: the OR operator ( &#124;&#124; ) in AS3 does not return true if either condition evaluates to true; it returns the <strong>actual value</strong> of the first condition to evaluate to true. What does that mean? Lets try an example: [...] ]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tip: the OR operator ( || ) in AS3 does not return true if either condition evaluates to true; it returns the <strong>actual value</strong> of the first condition to evaluate to true.</p>
<p>What does that mean? Lets try an example:<br />
This statement:</p>
<pre class="brush: as3">trace ( "foo" || "bar" );</pre>
<p>will trace out the string &#8220;foo&#8221;, not &#8220;true&#8221; (in an if statement &#8220;foo&#8221; will evaluate to true).</p>
<p>This statement:</p>
<pre class="brush: as3">trace ( undefined || false || "bar" );</pre>
<p>will trace out the string &#8220;bar&#8221;.</p>
<p>If no condition evaluates to true, it will return the last condition.</p>
<pre class="brush: as3">trace ( false || undefined || 0 || "" || NaN || null );</pre>
<p>will trace out &#8220;null&#8221;.</p>
<p>This can be really handy when making sure variables are not uninitialized before using them.<br />
Check out this example:</p>
<pre class="brush: as3">function doSomething(arr:Array, data:Object, path:String):void {
    this.args = arr || [];
    this.dataObject = data || {};
    this.dataUrl = path || "http://default.url";
}</pre>
<p>And even sexier (thanks <a href="http://www.tyroneneill.com/">MonkeyMagiic</a>):</p>
<pre class="brush: as3">this.args ||= [];</pre>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2010/09/the-or-operator-in-as3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash Debug Player crashing Firefox</title>
		<link>http://flassari.is/2010/08/flash-debug-player-crashing-firefox/</link>
		<comments>http://flassari.is/2010/08/flash-debug-player-crashing-firefox/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 11:36:52 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[3.6.6]]></category>
		<category><![CDATA[45 seconds]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[flash debug player]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[plugin-container]]></category>
		<category><![CDATA[plugin-container.exe]]></category>
		<category><![CDATA[popup]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=335</guid>
		<description><![CDATA[After I updated Firefox past version 3.6.6 I started noticing some weird behavior when Flash Debug Player threw an error. Sometimes I would not be able to dismiss the error popup. Instead, it would freeze for almost a minute and then crash the flash plugin. It was nice that Firefox itself didn&#8217;t crash, but I [...]]]></description>
			<content:encoded><![CDATA[<p>After I updated Firefox past version 3.6.6 I started noticing some weird behavior when Flash Debug Player threw an error. Sometimes I would not be able to dismiss the error popup. Instead, it would freeze for almost a minute and then crash the flash plugin. It was nice that Firefox itself didn&#8217;t crash, but I found it quite irritating always having to kill the plugin-container.exe process to skip having to wait the 45 seconds every single time I visited a website with poorly written flash ads (majority of websites!).</p>
<p>Then I read <a href="http://nwebb.co.uk/blog/?p=538">nwebb&#8217;s blog post</a> about a fix to this problem. To quote the blog post:</p>
<div style="color: #555555; border: 1px solid; border-color: #999999; padding: 5px;">You need to go in to the Firefox config settings (type about:config in to the location bar) and search for dom.ipc.plugins.enabled.npswf32.dll – double click that to set it to false. You may also need to set dom.ipc.plugins.timeoutSecs to -1. Now restart your browser and you should once again be able to debug your apps and dismiss the warnings as you used to do in the good old days. Ahhhhh bliss.</div>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2010/08/flash-debug-player-crashing-firefox/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

