<?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>Ruben's blog</title>
	<atom:link href="http://www.rubenswieringa.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.rubenswieringa.com/blog</link>
	<description>Ruben Swieringa on Actionscript and a whole lot of other stuff..</description>
	<lastBuildDate>Mon, 15 Feb 2010 09:35:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Your Flex project overwrites your modules their styles</title>
		<link>http://www.rubenswieringa.com/blog/your-flex-project-overwrites-your-modules-their-styles</link>
		<comments>http://www.rubenswieringa.com/blog/your-flex-project-overwrites-your-modules-their-styles#comments</comments>
		<pubDate>Thu, 10 Dec 2009 19:50:28 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[styles]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/?p=259</guid>
		<description><![CDATA[This afternoon I found out that when you're defining styles for the same selector in your main Flex application and in one of your modules, the latter style-declaration will not be used, at all. I'm not sure whether this is a quirk that has yet to be documented or that it's something that has already [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon I found out that when you're defining styles for the same selector in your main Flex application <em>and</em> in one of your modules, the latter style-declaration will not be used, <em>at all</em>. I'm not sure whether this is a quirk that has yet to be documented or that it's something that has already been covered in the LiveDocs, but any feedback is welcome.</p>
<p><span id="more-259"></span></p>
<p>Consider a Flex project with one main application file, a module including a <code>Label</code> with its <code>styleName</code> set to "myLabel", and two CSS files: Main.mxml, MyModule.mxml, main.css and module.css.</p>
<p>The CSS files are included (<code>&lt;mx:Style source=".."/&gt;</code>) in their respective MXML files and look like this:</p>
<pre class="css"><span style="color: #808080; font-style: italic;">/* main.css: */</span>
<span style="color: #6666ff;">.myLabel</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #993333;">red</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<pre class="css"><span style="color: #808080; font-style: italic;">/* module.css: */</span>
<span style="color: #6666ff;">.myLabel</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">font-style</span>: <span style="color: #993333;">italic</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>When you run this application and load in the module with the <code>Label</code> in it you'll notice that it is colored red, but its text is not italicized.</p>
<p>If you set the <code>-keep-generated-actionscript</code> argument to <code>true</code> in the compiler-settings* you can have a look under the hood of the Flex framework and see what actually happens here. Once the compiler has run you'll have a new folder called <em>'generated'</em> in the <em>'src'</em> folder of your project, this is where all the classes go that Flex auto-creates for stuff like data-binding and also embedded styles.</p>
<p>Somewhere in the <em>generated</em> folder there should be a class called <code>MyModule-generated</code> in which there's a method called <code>_MyModule_StylesInit()</code>:</p>
<p><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2009/mymodule-generated.png" /></p>
<p>In the above code Flex starts by looking for an existing style-declaration for the stylename <em>"myLabel"</em> and if there is none it'll create a new one -- in our case there already is a style-declaration however (as we've made one in main.css).</p>
<p>Next, Flex examines the <code>factory</code>-property of the style-declaration (a <code>CSSStyleDeclaration</code> instance). The <code>factory</code>-property is a function that defines all style-values that were set at compile-time from the class associated with the generated class (in this case MyModule.mxml). The value of <a href="http://www.adobe.com/livedocs/flex/3/langref/mx/styles/CSSStyleDeclaration.html#factory"><code>CSSStyleDeclaration.factory</code></a> is usually generated by the compiler (as you can see on line 152-155).</p>
<p>This part of the method is where things go wrong; by only updating the <code>factory</code> if it is null, Flex assumes that a compile-time style-declaration can only be set at one location in your project -- whereas we set it at two (Main.mxml and MyModule.mxml).<br />
Because the <code>factory</code>-property of our style-declaration has already been set when the styles from main.css were initialized (by similar auto-generated code for Main.mxml) the styles from module.css will be disregarded.</p>
<p>I at the very least hope this might save some other developers from hours of searching around their code, let me know. Also, this a good read if you want to familiarize yourself on the topic of modules and CSS in Flex:<br />
<a href="http://viconflex.blogspot.com/2007/04/flex-modules-compile-and-run-time-css.html">viconflex.blogspot.com/2007/04/flex-modules-compile-and-run-time-css.html</a></p>
<p class="note">* Configure the compiler by setting options in the <em>'additional compiler arguments'</em> field of the project properties window (right-click your project, go to <em>'properties'</em> and then <em>'Flex Compiler'</em>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/your-flex-project-overwrites-your-modules-their-styles/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;could not resolve &lt;mx:&#8230;&gt; to a component implementation&#8221;</title>
		<link>http://www.rubenswieringa.com/blog/could-not-resolve-mx-to-a-component-implementation</link>
		<comments>http://www.rubenswieringa.com/blog/could-not-resolve-mx-to-a-component-implementation#comments</comments>
		<pubDate>Mon, 26 Oct 2009 10:53:54 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[manifest]]></category>
		<category><![CDATA[MXML]]></category>
		<category><![CDATA[ToolTip]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/?p=215</guid>
		<description><![CDATA[If you have ever tried to add mx.core.ToolTip (or certain other classes) as a mxml-tag to your Flex project then you might've run into the following compiler-error:
"Could not resolve &#60;mx:ToolTip&#62; to a component implementation."
So why does Flex (or rather MXMLC, the compiler) let you write &#60;mx:Button&#62; and &#60;mx:Canvas&#62; and all those other Flex components, but [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever tried to add <code>mx.core.ToolTip</code> (or certain other classes) as a mxml-tag to your Flex project then you might've run into the following compiler-error:</p>
<blockquote><p><em>"Could not resolve &lt;mx:ToolTip&gt; to a component implementation."</em></p></blockquote>
<p>So why does Flex (or rather MXMLC, the compiler) let you write <code>&lt;mx:Button&gt;</code> and <code>&lt;mx:Canvas&gt;</code> and all those other Flex components, but not <code>&lt;mx:ToolTip&gt</code> -- it's a native Flex class and it's in the <em>mx</em> package just like all of the others, right?</p>
<p>Fact is, it's not the <em>mx</em> class-package that defines whether or not you can add a component by saying <code>&lt;mx:...&gt;</code>, but rather the Flex component manifest file -- it describes which of the native Flex classes fall under the <em>mx</em> xml-namespace (or actually any namespace you want to use). I might write a post about manifest-files in Flex somewhere in the near future, but for now you'll have to <a href="http://livedocs.adobe.com/flex/3/html/compilers_31.html" title="About manifest files - Adobe Flex LiveDocs">read up in the docs</a> if you want to know more.</p>
<p>It so happens that the <code>ToolTip</code> class isn't included in the native Flex component manifest, and consequently the compiler won't be able to find it if you just write <em>"&lt;mx:ToolTip /&gt;"</em>. You can work around this by specifying a seperate xml-namespace for the <code>mx.controls</code> package:</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">xmlns:controls</span>=<span style="color: #ff0000;">&quot;mx.controls.*&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;controls:ToolTip</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre>
<p>Note that in the above example we can't change the value of the <em>xmlns:mx</em> attribute so that it would point to the <code>mx.controls</code> class-package, because if we would then the compiler wouldn't recognize the <code>&lt;mx:Application&gt;</code> tag anymore (since the <code>Application</code> class isn't in the <em>mx.controls</em> package).</p>
<p>Also, for the naysayers who completely miss the point and start talking about why on earth you would want to instantiate a <code>ToolTip</code> through mxml: To tell the truth I was wondering about this myself, but if you think about it, tooltips in Flex aren't restricted to just having whatever you put into <code>UIComponent.toolTip</code> automatically pop up when you mouse-over. In fact you may want to create a custom mxml-component subclass of <code>ToolTip</code> and manually add it to your application using the <code>ToolTipManager</code> class during runtime.</p>
<p>That having been said, <code>ToolTip</code> isn't the only Flex-class not included in the Flex component manifest, naturally what I wrote in this post also applies to any other class in the Flex framework that extends <code>UIComponent</code> but isn't included in the manifest.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/could-not-resolve-mx-to-a-component-implementation/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Player 10 crashes Internet Explorer with H.264 video</title>
		<link>http://www.rubenswieringa.com/blog/fp10-crashes-ie-with-h264</link>
		<comments>http://www.rubenswieringa.com/blog/fp10-crashes-ie-with-h264#comments</comments>
		<pubDate>Sat, 10 Oct 2009 12:35:34 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash player 10]]></category>
		<category><![CDATA[h.264]]></category>
		<category><![CDATA[hd]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/?p=209</guid>
		<description><![CDATA[At work we ran into this bug the other day, looking into it I found out that Adobe hasn't put any effort into documenting this one so I thought I'd give it a shot myself in order to try and raise awareness.
In short, the bug occurs with Flash content playing H.264 video in Internet Explorer [...]]]></description>
			<content:encoded><![CDATA[<p>At work we ran into this bug the other day, looking into it I found out that Adobe hasn't put any effort into documenting this one so I thought I'd give it a shot myself in order to try and raise awareness.</p>
<p>In short, the bug occurs with Flash content playing H.264 video in Internet Explorer with certain version of the Flash Player older than 10.0.32.18. Under these circumstances, if the video its playhead is set back to the start (seeking) then <strong>Flash Player will crash Internet Explorer</strong> -- not slowdown-crash, but actually end the process; the browser-window will be closed down (and with that, your Flash application).</p>
<p>We had this bug occur in both Internet Explorer 7 and 8, and upgrading the Flash Player to a newer version (10.0.32.18 or later) made the problem go away. I'm not completely sure whether this problem has been present since HD video functionality was introduced in the Flash Player, or that perhaps it only started later on. The computers we experienced this bug on though, had either Flash Player 10.0.2.54 or 10.0.12.36 installed.</p>
<p>I don't exactly know in which part of the native Actionscript libraries this issue starts, I presume it's in the VideoPlayer class (as I take it that that's where the actual video logic is implemented), but it might as well be in the FLVPlayback component.</p>
<p>Of course any additional information is very welcome, leave it in the comments. Also, there's <a href="http://help.youtube.com/group/youtube-issues/browse_thread/thread/d33615ffc0732458">this one thread in the YouTube Community Help Forums</a> that was somewhat helpful, check it out if you're interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/fp10-crashes-ie-with-h264/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flash on the Beach 2009 (photos)</title>
		<link>http://www.rubenswieringa.com/blog/fotb09</link>
		<comments>http://www.rubenswieringa.com/blog/fotb09#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:29:51 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/?p=189</guid>
		<description><![CDATA[I don't really feel like doing a full recap of three days of this year's Flash on the Beach (even though I had a most wonderful time), but some shots and videos I took came out pretty well, so I thought I'd post 'em (more photos on my flickr):

(above: Joshua Davis doing the very last [...]]]></description>
			<content:encoded><![CDATA[<p>I don't really feel like doing a full recap of three days of this year's <a href="http://www.flashonthebeach.com">Flash on the Beach</a> (even though I had a most wonderful time), but some shots and videos I took came out pretty well, so I thought I'd post 'em (more photos <a href="http://www.flickr.com/photos/rubenswieringa/sets/72157622323314733/">on my flickr</a>):</p>
<p><object type="application/x-shockwave-flash" width="500" height="376" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&photo_secret=07b10d739a&photo_id=3948418349"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&photo_secret=07b10d739a&photo_id=3948418349" height="376" width="500"></embed></object></p>
<p><em>(above: <a href="http://www.joshuadavis.com">Joshua Davis</a> doing the very last session of the conference.)</em></p>
<p><a href="http://www.flickr.com/photos/rubenswieringa/3949205852/"><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2009/fotb09/john_davey.jpg" alt="John Davey revealing the winners of the infamous flipflip-photo-contest at the end of the conference" title="John Davey revealing the winners of the infamous flipflip-photo-contest at the end of the conference" /></a></p>
<p><a href="http://www.flickr.com/photos/rubenswieringa/3949201172/"><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2009/fotb09/joshua_davis.jpg" alt="Joshua Davis" title="Joshua Davis" /></a></p>
<p><a href="http://www.flickr.com/photos/rubenswieringa/3948423835/"><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2009/fotb09/joshua_dancis.jpg" alt="Joshua Davis and his funky dance-moves" title="Joshua Davis and his funky dance-moves" /></a></p>
<p><object type="application/x-shockwave-flash" width="500" height="376" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&photo_secret=e95f90494d&photo_id=3946762277&flickr_show_info_box=true"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&photo_secret=e95f90494d&photo_id=3946762277&flickr_show_info_box=true" height="376" width="500"></embed></object></p>
<p><a href="http://www.flickr.com/photos/rubenswieringa/3947308769/"><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2009/fotb09/james_jarvis.jpg" alt="James Jarvis" title="James Jarvis" /></a></p>
<p><a href="http://www.flickr.com/photos/rubenswieringa/3947308877/"><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2009/fotb09/camera_guy.jpg" alt="Camera-guy during James Jarvis' session" title="Camera-guy during James Jarvis' session" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/fotb09/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A different use for custom namespaces (2/2)</title>
		<link>http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-2</link>
		<comments>http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-2#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:12:22 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[namespaces]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/?p=161</guid>
		<description><![CDATA[Note: Note that to keep the focus on the abstract/theoretical part of the subject I seperated the content over two seperate posts (of which this is the second). The previous explains the idea while this one shows a possbible use-case. I suggest you read the first post if you haven't already, it'll make things a [...]]]></description>
			<content:encoded><![CDATA[<p>Note: Note that to keep the focus on the abstract/theoretical part of the subject I seperated the content over two seperate posts (of which this is the second). <a href="http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-1">The previous</a> explains the idea while this one shows a possbible use-case. I suggest you read the first post if you haven't already, it'll make things a lot more clear.</p><p>This post provides some example-code for the concept presented in my <a href="http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-1">previous post</a>, please note that this post serves only to add some concrete material to the abstract idea presented in the previous post and that the focus should be on the latter rather than the former. This post is not at all about best practices or good/bad code-architecture.</p>
<p><span id="more-161"></span></p>
<p>I first started thinking about using namespaces for overriding methods when at the end of july I was talking to Tommy about a problem he was having. He had overridden <code>addChild()</code> in some distant <code>DisplayObject</code> subclass but in some situations still needed to use the original implementation of the method. Because for this he used <code>super.addChild()</code> he was forced to put a lot of different logic in that one single subclass.</p>
<p>The implementation of the double-overriding popped up when I suggested to store the original <code>addChild()</code> functionality in a duplicate function defined with a custom namespace and the same name, and then put the rest of the functionality in a subclass of the class that would override <code>addChild()</code>:</p>
<pre class="actionscript"><span style="color: #808080; font-style: italic;">// DisplayObjectOverridden.as:</span>
package
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;
   <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
   <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DisplayObjectOverridden <span style="color: #0066CC;">extends</span> Sprite
   <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> DisplayObjectOverridden <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#123;</span>
         <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
&nbsp;
      override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addChild<span style="color: #66cc66;">&#40;</span>child:DisplayObject<span style="color: #66cc66;">&#41;</span>:DisplayObject
      <span style="color: #66cc66;">&#123;</span>
         <span style="color: #808080; font-style: italic;">// custom functionality</span>
      <span style="color: #66cc66;">&#125;</span>
&nbsp;
      original <span style="color: #000000; font-weight: bold;">function</span> addChild <span style="color: #66cc66;">&#40;</span>child:DisplayObject<span style="color: #66cc66;">&#41;</span>:DisplayObject
      <span style="color: #66cc66;">&#123;</span>
         <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">super</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>child<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<pre class="actionscript"><span style="color: #808080; font-style: italic;">// OtherFunctionality.as:</span>
package
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
   <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> OtherFunctionality <span style="color: #0066CC;">extends</span> DisplayObjectOverridden
   <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> OtherFunctionality <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">var</span> normalChild:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
         addChild<span style="color: #66cc66;">&#40;</span>normalChild<span style="color: #66cc66;">&#41;</span>;
&nbsp;
         <span style="color: #000000; font-weight: bold;">var</span> specialChild:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
         original::addChild<span style="color: #66cc66;">&#40;</span>specialChild<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<pre class="actionscript"><span style="color: #808080; font-style: italic;">// original.as:</span>
package
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #0066CC;">public</span> namespace original;
<span style="color: #66cc66;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A different use for custom namespaces (1/2)</title>
		<link>http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-1</link>
		<comments>http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-1#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:11:38 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[namespaces]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/?p=156</guid>
		<description><![CDATA[Note: Note that to keep the focus on the abstract/theoretical part of the subject I seperated the content over two seperate posts. The first (this one) explains the idea while the second shows a possbible use-case and some example-code.When namespaces were first introduced in Actionscript 3 I thought it was all pretty cool, but still [...]]]></description>
			<content:encoded><![CDATA[<p>Note: Note that to keep the focus on the abstract/theoretical part of the subject I seperated the content over two seperate posts. The first (this one) explains the idea while <a href="http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-2">the second</a> shows a possbible use-case and some example-code.</p><p>When <a href="http://www.rubenswieringa.com/blog/namespaces-in-actionscript3">namespaces</a> were first introduced in Actionscript 3 I thought it was all pretty cool, but still I sort of had a difficult time thinking of actual use-cases.</p>
<p>What I initially would have liked to use custom namespaces for was to restrict access to certain properties/methods, to only be accessible for certain classes, in the way that <code>private</code> and <code>protected</code> enable you to -- unfortunately there is no simple way of defining who can import your namespace, consequently rendering namespaces somewhat useless for this particular use-case.</p>
<p>Then some time ago it struck me that rather than defining new members with a custom namespace, that you could of course also enhance an existing method instead (I admit this might seem like a no-brainer, but it took me a while to bump into).</p>
<p>Let's say you have a subclass that for regular (outside) usage needs to override a method in the superclass, but itself still needs to use the original (super-) method. You would probably just override the method in the subclass and use <code>super.method()</code> wherever you needed to use the original functionality.<br />
Now let's say that you need to make a subclass <em>of</em> your subclass, which would also require access to the original functionality in said method. All of a sudden <code>super.method()</code> will not work for you anymore.</p>
<p>Here's where namespaces start coming in handy, while still simply overriding the method in the first subclass, you also implement a function with the same name <em>but</em> with your own namespace (for example <em>"original"</em>). Then whenever you need to call the original implementation you can call <code>original::method()</code>, regardless of how deep down in the inheritance-chain you are.</p>
<p>This is only one use-case, you could for instance also use this concept to work around the nasty <a href="http://www.rubenswieringa.com/blog/ambiguous-reference-bug-for-namespaces-in-flex">ambiguous-reference bug</a> you get (or used to get) when declaring a getter and a setter with different (native) namespaces.</p>
<p>To keep the focus on the above described concept I put the example-code in <a href="http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-2">a seperate post, feel free to read on</a> though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/a-different-use-for-custom-namespaces-1/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Pathfinder &amp; Organisms (AI)</title>
		<link>http://www.rubenswieringa.com/blog/pathfinder-organisms-ai</link>
		<comments>http://www.rubenswieringa.com/blog/pathfinder-organisms-ai#comments</comments>
		<pubDate>Tue, 01 Apr 2008 10:51:24 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/pathfinder-organisms-ai</guid>
		<description><![CDATA[As promised, here is the project experiment that I originally wrote the pathfinder algorithm for.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_pathfinderdemo06_1498725277"
			class="flashmovie"
			width="400"
			height="375">
	<param name="movie" value="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/pathfinderdemo06.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/pathfinderdemo06.swf"
			name="fm_pathfinderdemo06_1498725277"
			width="400"
			height="375">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
Here's how it works: 'Organisms' (the colored moving squares) are thrown into an infrastructure (a collection of connected points, i.e. the circle/star with connected dots). Each organism is assigned a certain destination-point within the infrastructure and carries [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, here is the <strike>project</strike> experiment that I originally wrote the <a href="http://www.rubenswieringa.com/blog/pathfinder-ai" title="Pathfinder (AI) - Ruben's blog">pathfinder algorithm</a> for.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_pathfinderdemo06_1482676208"
			class="flashmovie"
			width="400"
			height="375">
	<param name="movie" value="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/pathfinderdemo06.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/pathfinderdemo06.swf"
			name="fm_pathfinderdemo06_1482676208"
			width="400"
			height="375">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Here's how it works: 'Organisms' (the colored moving squares) are thrown into an infrastructure (a collection of connected points, i.e. the circle/star with connected dots). Each organism is assigned a certain destination-point within the infrastructure and carries with it a pathfinder (a polished version of the <a href="http://www.rubenswieringa.com/blog/pathfinder-ai" title="Pathfinder (AI) - Ruben's blog">algorithm I posted about some time ago</a>).</p>
<p>The pathfinder will figure out which points to travel (trial and error, guessing together a route to the assigned destination, <a href="http://www.rubenswieringa.com/blog/pathfinder-ai" title="Pathfinder (AI) - Ruben's blog">see previous post</a>) in order to reach the destination and will then tell its organism where to go.</p>
<p>When two organisms happen to travel the same connection (line between two points in an infrastructure) they will share and compare their knowledge about several of the paths they have traveled, this is visualised by both organisms becoming semi-transparent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/pathfinder-organisms-ai/feed</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Spaces in Flex Actionscript-only project-names</title>
		<link>http://www.rubenswieringa.com/blog/spaces-in-flex-actionscript-only-project-names</link>
		<comments>http://www.rubenswieringa.com/blog/spaces-in-flex-actionscript-only-project-names#comments</comments>
		<pubDate>Wed, 26 Mar 2008 19:58:16 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/spaces-in-flex-actionscript-only-project-names</guid>
		<description><![CDATA[Odd enough Flex Builder seems to hate it when you want spaces in the name of an Actionscript-only project:

Here's the rough guide to having spaces in your Flex Builder Actionscript-only project-names:



Kind of leaves me wondering, why all the fuss in the project-wizard if we can rename our projects in the navigator?
]]></description>
			<content:encoded><![CDATA[<p>Odd enough Flex Builder seems to hate it when you want spaces in the name of an Actionscript-only project:</p>
<p><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/spaces_in_as-only_projects/iwantspaces01.jpg" alt="Flex hates spaces, boo! :(" /></p>
<p>Here's the rough guide to having spaces in your Flex Builder Actionscript-only project-names:</p>
<p><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/spaces_in_as-only_projects/iwantspaces02.jpg" alt="Compromise, boo! :(" /></p>
<p><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/spaces_in_as-only_projects/iwantspaces03.jpg" alt="" /></p>
<p><img src="http://www.rubenswieringa.com/blog/wp-content/uploads/2008/spaces_in_as-only_projects/iwantspaces04.jpg" alt="Success, yay! :)" /></p>
<p>Kind of leaves me wondering, why all the fuss in the project-wizard if we can rename our projects in the navigator?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/spaces-in-flex-actionscript-only-project-names/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>SVN misplaces my Flex project-files</title>
		<link>http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files</link>
		<comments>http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files#comments</comments>
		<pubDate>Wed, 26 Mar 2008 19:15:49 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files</guid>
		<description><![CDATA[A little over a week ago I made a post about Flex running old versions of my SWF. In a nutshell; Flex Builder 3 seemed to disregard any changes I made to the classes in my (Actionscript-only) project, and compile an SWF with older versions of the edited classes.
A few days later however, I concluded [...]]]></description>
			<content:encoded><![CDATA[<p>A little over a week ago I made a <a href="http://www.rubenswieringa.com/blog/flex-3-stop-running-the-old-version-of-my-swf" title="Flex 3, stop running the old version of my SWF! - Ruben's blog">post about Flex running old versions of my SWF</a>. In a nutshell; Flex Builder 3 seemed to disregard any changes I made to the classes in my (Actionscript-only) project, and compile an SWF with older versions of the edited classes.</p>
<p>A few days later however, I concluded that it was not so much Flex 3 that was causing this issue, but rather  <a href="http://en.wikipedia.org/wiki/Subversion_%28software%29">Subversion</a>.</p>
<p>Whenever I commited my changes to the Subversion-repository, the latest run-files (<em>Main.swf</em> and <em>Main.html</em>) from the <em>bin-debug</em>-folder on my harddisk would be commited to the <em>html-template</em>-folder in the repository.<br />
As the <em>html-template</em>-folder serves as a template-depot (duh) for your Flex project, any files in it will be copied to the <em>bin-debug</em>-folder after compilation, effectively overwriting your freshly compiled SWF in this scenario.</p>
<p>Initially, this may go by unnoticed, as it will not be untill you update your project (or do a new checkout of the same project), that the run-files will be in the <em>html-template</em>-folder.</p>
<p>I work around this issue by commiting, updating, and removing the run-files from the <em>html-template</em>-folder, but I have yet to come across a proper solution for this problem. So any suggestions are more than welcome. The same goes for any explanation about this strange issue with Subversion..</p>
<p><strong>UPDATE:</strong>Through the comments <a href="http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files#comment-22712">someone exlained where this issue is coming from</a>, here's a quote:</p>
<blockquote><p><em>"your bin, bin-debug and html-template directories should *NOT* be committed to svn.</p>
<p>The problem you are having is that itâ€™s copying all of the files in the html-template folder into the bin-debug folder, including the .svn hidden folder. SVN uses the .svn folder to determine where to put the files in the repository, so when you copy that folder, even though itâ€™s in a different folder than when it started, the files will continue to be copied into the original location."</em></p></blockquote>
<p><strong>UPDATE:</strong> ..also, if you would like to keep these folders in your <abbr>SVN</abbr>-repository nevertheless, here's what you'll need to do (<a href="http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files#comment-23630">credits go to Matthew for this one</a>):</p>
<blockquote><p><em>"Goto your project properties and pull up the Flex Compiler tab and the first checkbox you should see says somethign to the effect of â€œCopy non-embedded files to the output directoryâ€, well uncheck that. This will allow you to keep your bin folders in the repo"</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Flex 3, stop running the old version of my SWF!</title>
		<link>http://www.rubenswieringa.com/blog/flex-3-stop-running-the-old-version-of-my-swf</link>
		<comments>http://www.rubenswieringa.com/blog/flex-3-stop-running-the-old-version-of-my-swf#comments</comments>
		<pubDate>Sat, 15 Mar 2008 19:22:02 +0000</pubDate>
		<dc:creator>Ruben</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.rubenswieringa.com/blog/flex-3-stop-running-the-old-version-of-my-swf</guid>
		<description><![CDATA[UPDATE: Turns out it wasn't so much Flex causing this ruckus, but rather Subversion:
rubenswieringa.com/blog/svn-misplaces-my-flex-project-files
I might've also have called this post "How many more times will I have to re-import my projects into Flex Builder 3!?", this sucks..
Today I decided to work on a project of mine, so I pulled in the latest version from my [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> Turns out it wasn't so much Flex causing this ruckus, but rather Subversion:<br />
<a href="http://www.rubenswieringa.com/blog/svn-misplaces-my-flex-project-files" title="SVN misplaces my Flex project-files - Ruben's blog">rubenswieringa.com/blog/svn-misplaces-my-flex-project-files</a></p>
<p>I might've also have called this post <em>"How many more times will I have to re-import my projects into Flex Builder 3!?"</em>, this sucks..</p>
<p>Today I decided to work on a project of mine, so I pulled in the latest version from my <a href="http://en.wikipedia.org/wiki/Subversion_%28software%29">Subversion</a>-repository and opened up Flex Builder 3.<br />
I started making some additions in classes etc. and eventually I ran the project. To my confusion the SWF I saw didn't reflect any of the changes I'd made, so I made some bigger changes and still nothing changed in the generated SWF.</p>
<p>Long story short, Flex just kept showing me the SWF of an older version of the project. Nothing I did helped; I cleaned the project, refreshed it, renamed it.<br />
Eventually I worked around this issue by deleting the project (not the files) from Flex Builder and creating a new one (same location and same main project-file).</p>
<p>Although I fixed this thing for now, my (fairly big) concern now is mainly about how many more times I will have to re-import my projects into Flex Builder 3..<br />
My guess is that this has something to do with the compiler-cache and <a href="http://livedocs.adobe.com/flex/3/html/compilers_20.html">incremental compilation</a>, but either way, I'd really appreciate it if the Flex Builder development-team would fix this.</p>
<p>Any suggestions are more than welcome. <img src='http://www.rubenswieringa.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubenswieringa.com/blog/flex-3-stop-running-the-old-version-of-my-swf/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
