<?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>Sebastiaan Holtrop &#187; Adobe Flex 3</title>
	<atom:link href="http://www.sebastiaanholtrop.com/archives/category/adobe-flex-3/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sebastiaanholtrop.com</link>
	<description>Creating stuff that works...</description>
	<lastBuildDate>Mon, 08 Feb 2010 11:39:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flex 3 localisation</title>
		<link>http://www.sebastiaanholtrop.com/archives/95</link>
		<comments>http://www.sebastiaanholtrop.com/archives/95#comments</comments>
		<pubDate>Wed, 18 Nov 2009 08:49:47 +0000</pubDate>
		<dc:creator>Sebastiaan</dc:creator>
				<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Localisation]]></category>
		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.sebastiaanholtrop.com/?p=95</guid>
		<description><![CDATA[Something I&#8217;ve found out this morning; If you want to include localized resourced in your project other then en_US, for instance nl_NL, you not only have to create resource files for your own application, but you also need to provide the localized resources for the Flex Framework components. Flex doesn&#8217;t have all these localized resources [...]]]></description>
			<content:encoded><![CDATA[<p>Something I&#8217;ve found out this morning; If you want to include localized resourced in your project other then en_US, for instance nl_NL, you not only have to create resource files for your own application, but you also need to provide the localized resources for the Flex Framework components. Flex doesn&#8217;t have all these localized resources out of the box, but Adobe provides a command line tool to copy these resources. It&#8217;s called copylocale.</p>
<p>Now I&#8217;m not frequent user of the command line, but I know terminal (on my mac) a bit, so I just navigated to the bin directory of my Flex sdk and did this:</p>
<pre>copylocale en_US nl_NL</pre>
<p>Didn&#8217;t work. Terminal just sais:</p>
<pre>-bash: copylocale: command not found</pre>
<p>Turns out you have to call the copylocale command from the root directory of your sdk, and include the /bin in the command call, like this:</p>
<pre>bin/copylocale en_US nl_NL</pre>
<p>Damn command line tools, no one ever tells you this stuff.</p>
<p>Some more info on runtime localisation:<br />
<a href="http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Runtime_Localization" target="_blank">http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Runtime_Localization</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastiaanholtrop.com/archives/95/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SebCoverFlow 2.2.1 available</title>
		<link>http://www.sebastiaanholtrop.com/archives/83</link>
		<comments>http://www.sebastiaanholtrop.com/archives/83#comments</comments>
		<pubDate>Thu, 09 Apr 2009 11:43:30 +0000</pubDate>
		<dc:creator>Sebastiaan</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Adobe Flex 2]]></category>
		<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[CoverFlow]]></category>
		<category><![CDATA[Flex 2]]></category>

		<guid isPermaLink="false">http://www.sebastiaanholtrop.com/?p=83</guid>
		<description><![CDATA[Since the release of the source code of my coverflow component there was just one bug that came up again and again. The coverflow couldn&#8217;t load images from a subdomain or another domain. I&#8217;ve fixed that one by adding a LoaderContext to the Image loader. The new sources and samples are available on the SebCoverFlow [...]]]></description>
			<content:encoded><![CDATA[<p>Since the release of the source code of my coverflow component there was just one bug that came up again and again. The coverflow couldn&#8217;t load images from a subdomain or another domain. I&#8217;ve fixed that one by adding a LoaderContext to the Image loader. The new sources and samples are available on the <a title="SebCoverFlow project page" href="http://www.sebastiaanholtrop.com/sebcoverflowprojectpage" target="_self">SebCoverFlow project page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastiaanholtrop.com/archives/83/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Create ASDoc code documentation with ANT</title>
		<link>http://www.sebastiaanholtrop.com/archives/38</link>
		<comments>http://www.sebastiaanholtrop.com/archives/38#comments</comments>
		<pubDate>Tue, 10 Feb 2009 09:48:56 +0000</pubDate>
		<dc:creator>Sebastiaan</dc:creator>
				<category><![CDATA[ASDoc]]></category>
		<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Ant]]></category>

		<guid isPermaLink="false">http://www.sebastiaanholtrop.com/?p=38</guid>
		<description><![CDATA[Working with command lines really sucks, so prefer automating any of those boring tasks by using any kind of script. Back when I was running Windows XP on a PC, I used batch files to do some of those tasks, but since I&#8217;m using a mac I can&#8217;t run batch files anymore. Furthermore, it was [...]]]></description>
			<content:encoded><![CDATA[<p>Working with command lines really sucks, so prefer automating any of those boring tasks by using any kind of script. Back when I was running Windows XP on a PC, I used batch files to do some of those tasks, but since I&#8217;m using a mac I can&#8217;t run batch files anymore. Furthermore, it was time to switch to something more professional than those oldschool batch files. I&#8217;ve been using ANT for quite some time now and I&#8217;ve created a really simple ANT script to create ASDoc documentation.</p>
<p><strong>What is ANT?</strong><br />
You can do about anyting with ANT by creating an ANT Script (xml) that tells ANT what to do. ANT can do anyting with files (copy, paste, move, duplicate, extract zip files, etc) and with ANT you can execute applications which you would normally use through the command line (or Terminal on a Mac).</p>
<p><strong>ASDoc ANT Script</strong><br />
Ok, back to the ASDoc ant script. Click &#8220;File -&gt; New -&gt; File&#8221; and create a file called asdocbuild.xml. Paste this code into the xml file:</p>

<div class="wp_codebox"><table><tr id="p382"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p38code2"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ASDoc build&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;createdocs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;asdoc.properties&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;createdocs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${asdoc.dir}/asdoc&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-doc-sources 'src/'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-main-title 'Undercore, a Flash and Flex development framework'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-window-title 'Undercore'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-output 'docs'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Some explanation of what happens in the xml file above: Obviously it&#8217;s an xml file (line 1).  The project tag defines the projectname of the build and the default target to execute, in this case the target on line 5 called createdocs. This node contains an exec node which tells ANT to execute a command line statement with the arguments contained in the exec tag. This is the actual asdoc execution.</p>
<p>Before it executes any of the targets, it loads a properties file. You can define variables in a properties file, such as ${asdoc.dir} which is defined as asdoc.dir in the property file. This is the properties file content:</p>
<pre>asdoc.dir=/Applications/Adobe Flex Builder 3 Plug-in/sdks/3.2.0/bin</pre>
<p>Just create a file named asdoc.properties and paste the code above in it. Your project should look something like this:</p>
<p><img class="alignnone size-full wp-image-73" title="ANT Project" src="http://www.sebastiaanholtrop.com/wp-content/antproject.gif" alt="ANT Project" width="196" height="164" /></p>
<p>Now right-click the asdocbuild.xml file and choose Run As -&gt; Ant Build. Your documentation&#8217;s being created.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastiaanholtrop.com/archives/38/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mask an Away3D scene in Flex</title>
		<link>http://www.sebastiaanholtrop.com/archives/29</link>
		<comments>http://www.sebastiaanholtrop.com/archives/29#comments</comments>
		<pubDate>Thu, 18 Sep 2008 20:59:48 +0000</pubDate>
		<dc:creator>Sebastiaan</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Adobe Flex 2]]></category>
		<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Away3D]]></category>

		<guid isPermaLink="false">http://www.sebastiaanholtrop.com/?p=29</guid>
		<description><![CDATA[An Away3D scene usually takes up the full width and height of the embedded swf file in the browser. In Flash you can easily solve this problem by masking the Away3D view.
The same thing goes for Flex, but Flex has it&#8217;s own measuring and sizing methods. I&#8217;ve come to know that it&#8217;s a great thing [...]]]></description>
			<content:encoded><![CDATA[<p>An Away3D scene usually takes up the full width and height of the embedded swf file in the browser. In Flash you can easily solve this problem by masking the Away3D view.</p>
<p>The same thing goes for Flex, but Flex has it&#8217;s own measuring and sizing methods. I&#8217;ve come to know that it&#8217;s a great thing as regards to performance, maintainability and scalability of your component to adapt to the Flex Framework.</p>
<p>In this case, I&#8217;ve extended a Flex component. The new Component contains an Away3D scene, which wants to take up the full width and height of my Flex Application. To solve this we need to override the updateDisplayList method. This method get&#8217;s called by the Flex Framework every time something in the measuring has changed. Here&#8217;s how it looks in code:</p>

<div class="wp_codebox"><table><tr id="p294"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code" id="p29code4"><pre class="actionscript" style="font-family:monospace;">override protected <span style="color: #000000; font-weight: bold;">function</span> updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:<span style="color: #0066CC;">Number</span>, unscaledHeight:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #0066CC;">super</span>.<span style="color: #006600;">updateDisplayList</span><span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// Set the clipping of the 3D scene to make sure only the visible elements are rendered,</span>
<span style="color: #808080; font-style: italic;">// this is great improvement for the performance</span>
<span style="color: #000000; font-weight: bold;">var</span> clipping:RectangleClipping = <span style="color: #000000; font-weight: bold;">new</span> RectangleClipping<span style="color: #66cc66;">&#40;</span>-<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>, -<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// Asign the clipping to the _view3D, in this case a private variable within my class</span>
_view3D.<span style="color: #006600;">clip</span> = clipping;
&nbsp;
<span style="color: #808080; font-style: italic;">// Remove the old mask if there is one</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_mask <span style="color: #66cc66;">!</span>= <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">removeChild</span><span style="color: #66cc66;">&#40;</span>_mask<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// Create a new mask</span>
_mask = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_mask.<span style="color: #006600;">x</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">x</span>;
_mask.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">y</span>;
_mask.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xFF0000,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
_mask.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span>, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
_mask.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// Add it to the displayList</span>
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>_mask<span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// And assign the mask to the view3D</span>
_view3D.<span style="color: #006600;">mask</span> = _mask;
&nbsp;
<span style="color: #808080; font-style: italic;">// And center the view3D in the available space</span>
_view3D.<span style="color: #006600;">x</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>;
_view3D.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>So as you see above, it&#8217;s quite straighforward. The clipping in the beginning of the method is not necessary for the masking, but since only the masked area is being displayed, there&#8217;s no need to render the invisible parts of the view3D.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastiaanholtrop.com/archives/29/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
