<?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>tripu &#187; Adobe Flex</title>
	<atom:link href="http://blog.tripu.info/item/category/flex/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.tripu.info</link>
	<description>1.0rc2</description>
	<lastBuildDate>Sat, 28 Aug 2010 11:38:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Nuevo grupo sobre Adobe Flex en Utoi</title>
		<link>http://blog.tripu.info/item/utoi</link>
		<comments>http://blog.tripu.info/item/utoi#comments</comments>
		<pubDate>Tue, 01 Sep 2009 14:03:14 +0000</pubDate>
		<dc:creator>tripu</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Spain]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Adobe Systems]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Cairngorm]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[grupo]]></category>
		<category><![CDATA[profesional]]></category>
		<category><![CDATA[professional]]></category>
		<category><![CDATA[PureMVC]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[Soitu]]></category>
		<category><![CDATA[tema]]></category>
		<category><![CDATA[topic]]></category>
		<category><![CDATA[Utoi]]></category>

		<guid isPermaLink="false">http://blog.tripu.info/?p=628</guid>
		<description><![CDATA[Si trabajas con Flex, ActionScript, Flash, Air, BlazeDS, AMF, Cairngorm, PureMVC u otras lenguas de programaci&#243;n de Adobe Systems o tecnolog&#237;as relacionadas quiz&#225; te interese pasarte por el nuevo grupo/tema que hemos creado en Utoi: Profesionales de Adobe Flex. Se trata de un grupo dedicado a todos aquellos que trabajan con Flex, o que quieren [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 24px;"><a href="http://utoi.soitu.es/*profesionalesadobeflex" title="&laquo;Profesionales de Adobe Flex&raquo;"><img src="http://farm3.static.flickr.com/2540/3878238548_11b21c866e_o_d.png" alt="Un logo que he perge&ntilde;ado" /></a></div>
<p><span class="capitals"><span class="huge">S</span>i trabajas con</span> <strong>Flex, ActionScript, Flash, Air, BlazeDS, AMF, Cairngorm, PureMVC u otras lenguas de programaci&oacute;n de <a href="http://www.adobe.com/es/" title="Sitio web en espa&ntilde;ol"><em>Adobe Systems</em></a> o tecnolog&iacute;as relacionadas</strong> quiz&aacute; te interese pasarte por el nuevo grupo/tema que hemos creado en Utoi: <a href="http://utoi.soitu.es/*profesionalesadobeflex" title="&laquo;Profesionales de Adobe Flex&raquo;"><em>Profesionales de Adobe Flex</em></a>.</p>
<p>Se trata de un grupo dedicado a todos aquellos que trabajan con Flex, o que quieren aprender m&aacute;s sobre la plataforma. Se admitir&aacute;n <strong>preguntas sobre programación, discusiones acerca de cualquier aspecto relacionado con Flex, recomendaciones de herramientas, avisos de eventos y, por supuesto, ofertas y demandas de empleo</strong> relacionadas con el tema.</p>
<p><a href="http://utoi.soitu.es" title="Una nueva red social y de &laquo;microblogging&raquo; espa&ntilde;ola">Utoi</a> est&aacute; a&uacute;n un poco en pa&ntilde;ales y de momento somos cuatro gatos (y muchos ya nos conoc&iacute;amos entre nosotros; somos los de siempre :) De hecho, este tema est&aacute; entre los nueve primeros que se han propuesto (y aprobado) en Utoi.</p>
<p>Por lo que me ha dicho la gente de Utoi, hoy es el lanzamiento &laquo;oficial&raquo; de Utoi en <a href="http://www.soitu.es/" title="soitu.es">Soitu</a> y, efectivamente, desde hoy est&aacute;n enlazando a la nueva red social y de <em>microblogging</em> desde la portada de Soitu (vaya nombres). A ver si eso le da un empuj&oacute;n al grupo de Flex&hellip;</p>
<hr />
<p><small><strong>Categories:</strong> <a href="http://blog.tripu.info/item/category/flex" title="View all posts in Adobe Flex" rel="category tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/category/computers" title="View all posts in Computers" rel="category tag">Computers</a>, <a href="http://blog.tripu.info/item/category/spain" title="View all posts in Spain" rel="category tag">Spain</a>; <strong>Tags:</strong> <a href="http://blog.tripu.info/item/tag/actionscript" rel="tag">ActionScript</a>, <a href="http://blog.tripu.info/item/tag/adobe" rel="tag">Adobe</a>, <a href="http://blog.tripu.info/item/tag/flex" rel="tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/tag/adobe-systems" rel="tag">Adobe Systems</a>, <a href="http://blog.tripu.info/item/tag/air" rel="tag">Air</a>, <a href="http://blog.tripu.info/item/tag/amf" rel="tag">AMF</a>, <a href="http://blog.tripu.info/item/tag/blazeds" rel="tag">BlazeDS</a>, <a href="http://blog.tripu.info/item/tag/cairngorm" rel="tag">Cairngorm</a>, <a href="http://blog.tripu.info/item/tag/flash" rel="tag">Flash</a>, <a href="http://blog.tripu.info/item/tag/group" rel="tag">group</a>, <a href="http://blog.tripu.info/item/tag/grupo" rel="tag">grupo</a>, <a href="http://blog.tripu.info/item/tag/profesional" rel="tag">profesional</a>, <a href="http://blog.tripu.info/item/tag/professional" rel="tag">professional</a>, <a href="http://blog.tripu.info/item/tag/puremvc" rel="tag">PureMVC</a>, <a href="http://blog.tripu.info/item/tag/social" rel="tag">social</a>, <a href="http://blog.tripu.info/item/tag/soitu" rel="tag">Soitu</a>, <a href="http://blog.tripu.info/item/tag/tema" rel="tag">tema</a>, <a href="http://blog.tripu.info/item/tag/topic" rel="tag">topic</a>, <a href="http://blog.tripu.info/item/tag/utoi" rel="tag">Utoi</a></small></p>
<p><a href="http://blog.tripu.info/item/utoi#comments">No comments yet</a>        © 2006-2010 <a href="http://tripu.info">tripu</a>        <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/2.0/uk/80x15.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tripu.info/item/utoi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Definitive howto: Flex Builder 3 in Ubuntu Linux 9.04</title>
		<link>http://blog.tripu.info/item/flex-linux</link>
		<comments>http://blog.tripu.info/item/flex-linux#comments</comments>
		<pubDate>Thu, 20 Aug 2009 15:44:54 +0000</pubDate>
		<dc:creator>tripu</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[FB3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[recipe]]></category>
		<category><![CDATA[set up]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.tripu.info/?p=559</guid>
		<description><![CDATA[Two weeks ago I had to reinstall Ubuntu. Yesterday I spent some time setting up Flex Builder in my new Linux installation. This time I faced even more difficulties than the last time, months ago. Definitely, Adobe is not paying much attention to its Linux developers&#160;&#8212;&#160;looking through Adobe.com and Adobe Labs, stuff regarding Flex development [...]]]></description>
			<content:encoded><![CDATA[<p><span class="capitals"><span class="huge">T</span>wo weeks ago I had</span> to reinstall <a href="http://ubuntu.com" title="Official web site">Ubuntu</a>. Yesterday I spent some time setting up <a href="http://adobe.com/products/flex" title="Adobe Flex 3 web page">Flex Builder</a> in my new <a href="http://en.wikipedia.org/wiki/Linux" title="In Wikipedia">Linux</a> installation. This time I faced even more difficulties than the last time, months ago. <strong>Definitely, <a href="http://adobe.com" title="Official web site">Adobe</a> is not paying much attention to its Linux developers</strong>&nbsp;&mdash;&nbsp;looking through <a href="http://adobe.com" title="http://adobe.com">Adobe.com</a> and <a href="http://labs.adobe.com" title="http://labs.adobe.com">Adobe Labs</a>, stuff regarding Flex development in Linux stays pretty much as (bad as) it was one year ago or so.</p>
<p>I finally managed to get the Flex 3 <abbr title="Integrated Development Environment">IDE</abbr> and version 3.0.0 of the <a href="http://adobe.com/products/air" title="Adobe AIR web page"><abbr title="Adobe Integrated Runtime">AIR</abbr></a> <abbr title="Software Development Kit">SDK</abbr> to run with <a href="http://eclipse.org" title="Official web site">Eclipse</a> 3.3.2, and to launch both the AIR runtime and the <a href="http://adobe.com/flashplatform" title="Adobe Flash Platform web page">Flash</a> plug-in for <a href="http://mozilla.org/firefox" title="Official web page">Firefox</a> from within Eclipse as needed (<em>run</em> and <em>debug</em> modes).</p>
<p>The process is no <code>apt-get install</code>, and is not well documented. At the end I combined <a href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/releasenotes.html#install" title="&ldquo;Installation and Uninstallation&rdquo;">instructions</a> and <a href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/releasenotes.html#air" title="&ldquo;Updating the Version of Adobe AIR for Linux Used by Flex Builder Linux&rdquo;">tips</a> from Adobe Labs, <a href="http://ubuntuforums.org/showthread.php?t=1084615" title="&ldquo;Flex Builder Linux not workgin with latest AIr update&rdquo;">one</a> or <a href="http://forums.adobe.com/thread/210332" title="&ldquo;Flex Builder Linux not working after AIR update&rdquo;">two</a> comments from forums and the workaround for <a href="http://bugs.adobe.com/jira/browse/FBE-323" title="&ldquo;After updating to AIR SDK 1.5.1 all Flex AIR apps give &quot;abc bytecode decoding&quot; error&rdquo;">a bug filed in Jira</a>. <strong>This recipe summarises the process in detail and, following it step by step, in a few minutes you will be running Flex Builder 3 in Ubuntu 9.04 <em>Jaunty Jackalope</em>.</strong> This recipe might be applicable to other versions of Ubuntu, and even to other <a href="http://debian.org" title="&ldquo;The Universal Operating System&rdquo;">Debian</a>-based distros.</p>
<p>There are six main steps:</p>
<ol>
<li>Install a <abbr title="Java Runtime Environment">JRE</abbr></li>
<li>Install the Eclipse SDK</li>
<li>Install the <abbr title="Flex Builder 3">FB3</abbr> plug-in for Eclipse</li>
<li>Back up one <abbr title="ShockWave Control">SWC</abbr> library</li>
<li>Upgrade the AIR SDK</li>
<li>Repair the offending SWC library from the backup</li>
</ol>
<p>A few notes before going into details. First of all, bear in mind that <strong>the Linux version of FB3 is an unsupported alpha, and that <a href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/releasenotes.html#features" title="&ldquo;Unsupported Flex Builder Features&rdquo;">some key features are (still) missing in it</a></strong>. The most important one is <a href="http://blog.tripu.info/item/fb3" title="Something I wrote about FB3's design view">the <em>design view</em></a>, but also the <em>states view</em>, the <em>profiler</em> and four other features. If these are important limitations for you, you might need to consider virtualisation instead (or a different base <abbr title="Operating System">OS</abbr> altogether).</p>
<p>Second, <strong>there is no stand-alone FB3 for Linux</strong>. Flex developers running Windows or Mac OS are used to installing either the FB3 plug-in on top of an existing Eclipse installation <em>or</em> the FB3 stand-alone bundle provided by Adobe. In Linux, on the other hand, there is no option but to install the Eclipse SDK first, and then the FB3 plug-in on top of it.</p>
<p>Third, Java is a dependency: the FB3 plug-in needs Eclipse, and Eclipse needs a JRE.</p>
<p>Fourth, if you plan to build AIR applications for the desktop (as opposed to Flash applications for the web) you might need to install the <a href="http://get.adobe.com/air" title="Get it from Adobe.com">AIR runtime</a> separately, in addition to the steps listed here.</p>
<p>Finally, here I use <a href="http://gnu.org/software/bash" title="The &ldquo;Bourne-again shell&rdquo;">Bash</a> commands to illustrate these steps in detail and without ambiguity; but most of these steps, if not all of them, you can accomplish using your file manager and visual tools of choice instead.</p>
<ol>
<li><strong>Install a JRE</strong>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sun-java6-jre</pre></div></div>

</div>
<p class="no-indent">This will also install <code>sun-java6-bin</code>.<br />
You can now check that Java has been installed successfully, the usual way:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java <span style="color: #660033;">-version</span></pre></div></div>

</div>
</li>
<li><strong>Install the Eclipse SDK</strong><br />
From all the bundles that <a href="http://eclipse.org" title="http://eclipse.org">Eclipse.org</a> provides, pick and download a minimal Eclipse SDK (you won&#8217;t need all those fancy plug-ins, and they can be added after the installation anyway).<br />
Whatever the bundle, <strong>it needs to be version 3.3.x, codename <em>Europa</em></strong>.<br />
The <a href="http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/europawinter" title="&ldquo;Eclipse IDE for Java Developers&rdquo;">IDE &ldquo;for Java developers&rdquo; [Europa]</a> is the best option:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #ff0000;">&quot;http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/europa/winter/eclipse-java-europa-winter-linux-gtk.tar.gz&quot;</span></pre></div></div>

</div>
<p class="no-indent">Extract the files from the archive and then move the base <code>eclipse/</code> directory to, for example, <code>/usr/local/</code>:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> eclipse-java-europa-winter-linux-gtk.tar.gz
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> eclipse <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</div>
<p class="no-indent">Create a permanent workspace for Eclipse:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>eclipse-workspace<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</div>
<p class="no-indent">Launch Eclipse:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>eclipse<span style="color: #000000; font-weight: bold;">/</span>eclipse <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

</div>
</li>
<p class="no-indent">During the first initialisation it will prompt for a workspace. Browse to the directory that you just created (<code>~/eclipse-workspace/</code>).<br />
Check that Eclipse works (you can write and run a <em>helloworld</em> in Java).<br />
Close Eclipse.</p>
<li><strong>Install the FB3 plug-in for Eclipse</strong><br />
Download <a href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/" title="Get it from Adobe Labs">Flex Builder for Linux</a> and give yourself permission to run the file:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #ff0000;">&quot;http://download.macromedia.com/pub/labs/flex/flexbuilder_linux/flexbuilder_linux_install_a4_081408.bin&quot;</span>
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> u+x flexbuilder_linux_install_a4_081408.bin</pre></div></div>

</div>
<p class="no-indent">Create a new directory for FB3 and make it your own:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #007800;">$USER</span>:<span style="color: #007800;">$USER</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</div>
<p class="no-indent">Run the installer:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>flexbuilder_linux_install_a4_081408.bin</pre></div></div>

</div>
<p class="no-indent">Accept the license.<br />
When asked where to install Flex Builder, browse to the directory you just created (<code>/usr/local/flex-builder/</code>).<br />
When asked where Eclipse is currently installed, browse to the directory where you copied Eclipse (<code>/usr/local/eclipse/</code>).<br />
If you plan to develop for the <a href="http://get.adobe.com/flashplayer" title="Get it from Adobe.com">Flash Player</a>, tick the option to install the debug version of Flash Player 9 for Firefox (but you might be able to download it separately anyway).<br />
The &ldquo;pre-installation summary&rdquo; should look similar to this:</p>
<p class="no-indent centred"><a href="http://flickr.com/photos/tripu/3839380421" title="Go to Flickr to see this image"><img src="http://farm4.static.flickr.com/3493/3839380421_2822a02ae0_d.jpg" title="Go to Flickr to see this image" /></a></p>
<p class="no-indent">Once the installation finishes you can launch FB3:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>Adobe_Flex_builder.sh <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

</div>
<p class="no-indent">Flash projects will run fine &hellip;but most likely AIR projects won&#8217;t work. When you try to build and launch an AIR app, you will see this error message in Eclipse:</p>
<p class="no-indent centred"><a href="http://flickr.com/photos/tripu/3840169552" title="Go to Flickr to see this image"><img src="http://farm4.static.flickr.com/3443/3840169552_ff18209970_o_d.png" title="Go to Flickr to see this image" /></a></p>
</li>
<li><strong>Back up one SWC library</strong>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>3.0.0<span style="color: #000000; font-weight: bold;">/</span>frameworks<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>air<span style="color: #000000; font-weight: bold;">/</span>airglobal.swc ~</pre></div></div>

</div>
</li>
<li><strong>Upgrade the AIR SDK</strong><br />
Download the <a href="http://adobe.com/products/air/tools/sdk" title="Get it from Adobe.com">AIR SDK for Linux</a> to a temporary directory and uncompress it:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>tmp-air<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>tmp-air<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #ff0000;">&quot;http://airdownload.adobe.com/air/lin/download/latest/air_1.5_sdk.tbz2&quot;</span>
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xjf</span> air_1.5_sdk.tbz2
$ <span style="color: #c20cb9; font-weight: bold;">rm</span> air_1.5_sdk.tbz2</pre></div></div>

</div>
<p class="no-indent">Delete the current SDK 3.0.0 <code>runtime/</code> directory from the FB3 installation directory:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>3.0.0<span style="color: #000000; font-weight: bold;">/</span>runtimes<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</div>
<p class="no-indent">Overwrite the SDK 3.0.0 with the version you downloaded (it will overwrite some files&nbsp;&mdash;&nbsp;that&#8217;s fine):</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-a</span> ~<span style="color: #000000; font-weight: bold;">/</span>tmp-air<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>3.0.0<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</div>
<p class="no-indent">Replace these two files:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>3.0.0<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">rm</span> adl_lin adt_lin
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> adl adl_lin
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> adt adt_lin</pre></div></div>

</div>
<p class="no-indent">Create this new symbolic link:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>3.0.0<span style="color: #000000; font-weight: bold;">/</span>runtimes<span style="color: #000000; font-weight: bold;">/</span>air<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> linux<span style="color: #000000; font-weight: bold;">/</span> Linux</pre></div></div>

</div>
<p class="no-indent">Now it will <em>almost</em> work. When you run FB3 and try to run an AIR app, you will get this error:</p>
<p class="no-indent centred"><a href="http://flickr.com/photos/tripu/3839379717" title="Go to Flickr to see this image"><img src="http://farm3.static.flickr.com/2479/3839379717_2f25654446_o_d.png" title="Go to Flickr to see this image" /></a></p>
</li>
<li><strong>Repair the offending SWC library from the backup</strong>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>airglobal.swc <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>flex-builder<span style="color: #000000; font-weight: bold;">/</span>sdks<span style="color: #000000; font-weight: bold;">/</span>3.0.0<span style="color: #000000; font-weight: bold;">/</span>frameworks<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>air<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

</div>
<p class="no-indent">This will fix the previous error. Try to build Flash and AIR apps again in FB3; everything should work fine.</p>
</li>
</ol>
<hr />
<p><small><strong>Categories:</strong> <a href="http://blog.tripu.info/item/category/flex" title="View all posts in Adobe Flex" rel="category tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/category/computers" title="View all posts in Computers" rel="category tag">Computers</a>, <a href="http://blog.tripu.info/item/category/images" title="View all posts in Images" rel="category tag">Images</a>, <a href="http://blog.tripu.info/item/category/work" title="View all posts in Work" rel="category tag">Work</a>; <strong>Tags:</strong> <a href="http://blog.tripu.info/item/tag/adobe" rel="tag">Adobe</a>, <a href="http://blog.tripu.info/item/tag/flex" rel="tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/tag/air" rel="tag">Air</a>, <a href="http://blog.tripu.info/item/tag/bug" rel="tag">bug</a>, <a href="http://blog.tripu.info/item/tag/debian" rel="tag">Debian</a>, <a href="http://blog.tripu.info/item/tag/development" rel="tag">development</a>, <a href="http://blog.tripu.info/item/tag/error" rel="tag">error</a>, <a href="http://blog.tripu.info/item/tag/fb3" rel="tag">FB3</a>, <a href="http://blog.tripu.info/item/tag/flash" rel="tag">Flash</a>, <a href="http://blog.tripu.info/item/tag/flex-builder" rel="tag">Flex Builder</a>, <a href="http://blog.tripu.info/item/tag/how-to" rel="tag">how to</a>, <a href="http://blog.tripu.info/item/tag/howto" rel="tag">howto</a>, <a href="http://blog.tripu.info/item/tag/install" rel="tag">install</a>, <a href="http://blog.tripu.info/item/tag/installation" rel="tag">installation</a>, <a href="http://blog.tripu.info/item/tag/linux" rel="tag">Linux</a>, <a href="http://blog.tripu.info/item/tag/recipe" rel="tag">recipe</a>, <a href="http://blog.tripu.info/item/tag/set-up" rel="tag">set up</a>, <a href="http://blog.tripu.info/item/tag/setup" rel="tag">setup</a>, <a href="http://blog.tripu.info/item/tag/software-development" rel="tag">software development</a>, <a href="http://blog.tripu.info/item/tag/tip" rel="tag">tip</a>, <a href="http://blog.tripu.info/item/tag/ubuntu" rel="tag">Ubuntu</a></small></p>
<p><a href="http://blog.tripu.info/item/flex-linux#comments">14 comments so far</a>        © 2006-2010 <a href="http://tripu.info">tripu</a>        <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/2.0/uk/80x15.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tripu.info/item/flex-linux/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Getting FB3&#8242;s design view to work with your MXML components</title>
		<link>http://blog.tripu.info/item/fb3</link>
		<comments>http://blog.tripu.info/item/fb3#comments</comments>
		<pubDate>Thu, 12 Feb 2009 23:19:24 +0000</pubDate>
		<dc:creator>tripu</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design view]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[FB3]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Flex Builder 3]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[transcode]]></category>
		<category><![CDATA[transcoding]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://blog.tripu.info/?p=246</guid>
		<description><![CDATA[For the past ten months I have been working on the same Flex/Air application. It is part of a larger, multi-tiered, multi-language project, of which the Flex subproject is but the front-end. (Actually, I have been involved in one of the other tiers, too, messing with a different programming language; not all my time has [...]]]></description>
			<content:encoded><![CDATA[<p><span class="capitals"><span class="huge">F</span>or the past ten</span> months I have been working on the same <a href="http://en.wikipedia.org/wiki/Adobe_Flex" title="@WP">Flex</a>/<a href="http://en.wikipedia.org/wiki/Adobe_Air" title="@WP"><acronym title="Adobe Integrated Runtime">Air</acronym></a> application. It is part of a larger, multi-tiered, multi-language project, of which the Flex subproject is but the front-end. (Actually, I have been involved in one of the other tiers, too, messing with a different programming language; not all my time has been devoted to Flex development during this year.)</p>
<p>Our Flex codebase is a nice instance of a complex, heterogeneous Air application to which probably more than twenty developers have contributed to date. A not-so-well-known Flex <acronym title="Model-view-controller">MVC</acronym> framework is at the core of the architecture, and we leverage quite a good number of Flex components and <a href="http://en.wikipedia.org/wiki/Adobe_Flash" title="@WP">Flash</a> libraries from third parties. We do unit testing, code coverage and continuous integration.</p>
<p>Ever since I joined the team (when the guys had just upgraded from the beta 3 of Air to Air 1.0) there has been an odd issue with the Air project in <a href="http://en.wikipedia.org/wiki/Flex_Builder" title="@WP">Flex Builder 3</a>: <strong>we could not use <acronym title="Flex Builder 3">FB3</acronym>&#8216;s “design view” to preview the layout of the application or to edit our custom <a href="http://en.wikipedia.org/wiki/MXML" title="@WP"><acronym title="MX XML">MXML</acronym></a> components</strong>.</p>
<p>The problems were two. First, <strong>the design view displayed what looked like a blank canvas&nbsp;&mdash;&nbsp;sometimes with whimsical wireframe edges that seemed to represent containers and other children</strong>. But only a few of those children appeared (if any at all). Rarely their sizes and positions were right, or their actual contents visible (see the screenshot below). Only when previewing simple components that inherited directly from Flex standard components (and <em>not</em> from our own components) the result seemed correct.</p>
<p class="no-indent centred"><a href="http://flickr.com/photos/tripu/3274607053" title="FB3, design view"><img src="http://farm4.static.flickr.com/3356/3274607053_7b92d9d0d7_d.jpg" title="FB3, design view" /></a></p>
<p>The second problem was that <strong>when switching from code view to design view a pair of errors suddenly appeared for every custom font that the project uses</strong> (even if the project builds just fine in code view):</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">unable to resolve '/project/assets/fonts/customFont.ttf' for transcoding | project | line 195
Unable to transcode /project/assets/fonts/customFont.ttf.                | project | line 195</pre></div></div>

</div>
<p>We gave it a go at trying to solve these issues at the time (ten months ago), with no luck. It never was much of a problem, though. Not for me at least, since I usually prefer to work on code view, even for building layouts and style-tweaking (in design view FB3 is slow rendering your changes, and I&#8217;m too fussy with my code to accept the auto-generated MXML). But boy, was it annoying.</p>
<p>A few days ago I investigated these problems again for a while&hellip; and this time I cracked it. Let me share what I learnt, because I think it is not that obvious.</p>
<p>The main problem has to do with the limitations of the design view in FB3. As you probably know (because you bothered to read this far), MXML is just a more readable way to describe <em>visual</em> Flash objects. MXML is more intuitive than <a href="http://en.wikipedia.org/wiki/ActionScript" title="@WP">ActionScript</a> to define the layout of your Flex <acronym title="Graphical User Interface">GUI</acronym> precisely because the nesting of <acronym title="eXtensible Markup Language">XML</acronym> nodes in MXML matches the nesting of visual components that those XML nodes represent. Actually, the Flex <acronym title="Software Development Kit">SDK</acronym> compiles all MXML classes to intermediate <acronym title="ActionScript">AS</acronym>. If you know that, you would presume that Flex Builder treats both AS classes and MXML classes in pretty much the same way. Well, it doesn&#8217;t.</p>
<p>It turns out that <strong>the “design view” can render any MXML class, provided that all its ancestor classes (up to the first standard Flash component) are defined in MXML too, i.e. not in AS</strong>.</p>
<p>In our project we had the situation represented in the diagram below. Most of the “screens” or “pages” in our application are based (directly or indirectly) on a common class. That common class, in turn, inherits from some other class that is defined within the MVC framework. The problem was, that common class was written in ActionScript, thus cutting off the hierarchy of MXML classes that the design view in FB3 “understands”.</p>
<p class="no-indent centred"><a href="http://flickr.com/photos/tripu/3275430202" title="Flex Class diagram"><img src="http://farm4.static.flickr.com/3420/3275430202_3fd4096102_o_d.png" title="Flex Class diagram" /></a></p>
<p>All I had to do was rewrite that class in MXML and keep the name of the file, changing its extension from <code>as</code> to <code>mxml</code>. It was a quick change: the class was short and I could maintain parts of the original ActionScript embedded within a <a href="http://livedocs.adobe.com/flex/3/html/usingas_2.html#216750" title="Adobe Flex 3 Help"><code>Script</code></a> component anyway. Note that no other changes were necessary, because the subclasses don&#8217;t care whether their superclass is originally written in AS or in MXML.</p>
<p>As for the other issue (the problem with the custom font families), it seems that <strong>the design view can&#8217;t load custom fonts unless they are defined as embedded resources in AS, i.e. not in separate <acronym title="Cascading Style Sheets">CSS</acronym> files</strong>.</p>
<p>Originally we had something like this:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:WindowedApplication</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span> source=<span style="color: #ff0000;">&quot;../styles/fonts.css&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- … --&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:WindowedApplication</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</div>
<p>Where <code>styles/fonts.css</code> contained:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;_DefaultFont&quot;</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    src<span style="color: #00AA00;">:</span>         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;../assets/fonts/verdana.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;_DefaultFontBold&quot;</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
    src<span style="color: #00AA00;">:</span>         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;../assets/fonts/verdanab.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

</div>
<p>I removed the CSS file and embeded the two font families directly into the MXML component (which is less elegant, of course):</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>WindowedApplication xmlns<span style="color: #000000; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Embed<span style="color: #000000;">&#40;</span><span style="color: #004993;">source</span>=<span style="color: #990000;">'../assets/fonts/verdana.ttf'</span>, fontWeight=<span style="color: #990000;">'normal'</span>,
            <span style="color: #004993;">fontName</span>=<span style="color: #990000;">'_DefaultFont'</span>, mimeType=<span style="color: #990000;">'application/x-font'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> thisObjectIsNeverUsedButItHasToExist_1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Class</span>;
&nbsp;
        <span style="color: #000000;">&#91;</span>Embed<span style="color: #000000;">&#40;</span><span style="color: #004993;">source</span>=<span style="color: #990000;">'../assets/fonts/verdanab.ttf'</span>, fontWeight=<span style="color: #990000;">'bold'</span>,
            <span style="color: #004993;">fontName</span>=<span style="color: #990000;">'_DefaultFontBold'</span>, mimeType=<span style="color: #990000;">'application/x-font'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> thisObjectIsNeverUsedButItHasToExist_2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Class</span>;
&nbsp;
    <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;!--</span> … <span style="color: #000000; font-weight: bold;">--&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>WindowedApplication<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

</div>
<p>I guess the moral of the story is: <em><a href="http://www.adobe.com" title="Adobe Systems Inc.">Adobe</a>, we need a better <acronym title="Integrated Development Environment">IDE</acronym>!</em></p>
<hr />
<p><small><strong>Categories:</strong> <a href="http://blog.tripu.info/item/category/flex" title="View all posts in Adobe Flex" rel="category tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/category/computers" title="View all posts in Computers" rel="category tag">Computers</a>, <a href="http://blog.tripu.info/item/category/work" title="View all posts in Work" rel="category tag">Work</a>; <strong>Tags:</strong> <a href="http://blog.tripu.info/item/tag/adobe" rel="tag">Adobe</a>, <a href="http://blog.tripu.info/item/tag/flex" rel="tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/tag/air" rel="tag">Air</a>, <a href="http://blog.tripu.info/item/tag/class" rel="tag">class</a>, <a href="http://blog.tripu.info/item/tag/css" rel="tag">CSS</a>, <a href="http://blog.tripu.info/item/tag/design-view" rel="tag">design view</a>, <a href="http://blog.tripu.info/item/tag/eclipse" rel="tag">Eclipse</a>, <a href="http://blog.tripu.info/item/tag/embed" rel="tag">embed</a>, <a href="http://blog.tripu.info/item/tag/error" rel="tag">error</a>, <a href="http://blog.tripu.info/item/tag/fb3" rel="tag">FB3</a>, <a href="http://blog.tripu.info/item/tag/flex-3" rel="tag">Flex 3</a>, <a href="http://blog.tripu.info/item/tag/flex-builder" rel="tag">Flex Builder</a>, <a href="http://blog.tripu.info/item/tag/flex-builder-3" rel="tag">Flex Builder 3</a>, <a href="http://blog.tripu.info/item/tag/font" rel="tag">font</a>, <a href="http://blog.tripu.info/item/tag/issue" rel="tag">issue</a>, <a href="http://blog.tripu.info/item/tag/resource" rel="tag">resource</a>, <a href="http://blog.tripu.info/item/tag/transcode" rel="tag">transcode</a>, <a href="http://blog.tripu.info/item/tag/transcoding" rel="tag">transcoding</a>, <a href="http://blog.tripu.info/item/tag/trick" rel="tag">trick</a></small></p>
<p><a href="http://blog.tripu.info/item/fb3#comments">6 comments so far</a>        © 2006-2010 <a href="http://tripu.info">tripu</a>        <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/2.0/uk/80x15.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tripu.info/item/fb3/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adobe Flex in 10 minutes</title>
		<link>http://blog.tripu.info/item/flex</link>
		<comments>http://blog.tripu.info/item/flex#comments</comments>
		<pubDate>Thu, 20 Mar 2008 10:57:25 +0000</pubDate>
		<dc:creator>tripu</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.tripu.info/item/flex</guid>
		<description><![CDATA[If you are a software developer, a web designer or some other sort of techie it&#8217;s very likely that you have been hearing and/or reading about Adobe Flex lately. Well, if you aren&#8217;t using it yourself but feel curious about it, or if you just want to have a notion, this extremely quick introduction is [...]]]></description>
			<content:encoded><![CDATA[<p><span class="capitals"><span class="huge">I</span>f you are</span> a software developer, a web designer or some other sort of techie it&#8217;s very likely that you have been hearing and/or reading about <a href="http://www.adobe.com/products/flex/" title="Adobe's official web page for Flex">Adobe Flex</a> lately. Well, if you aren&#8217;t using it yourself but feel curious about it, or if you just want to have a notion, this extremely quick introduction is for you. Skimming through this post will not turn you into a Flex developer, but it will allow you to nod confidently and even drop some canny words the next time that Flex pops up in a conversation around the watercooler.</p>
<p>First things first &mdash; <strong>what Adobe Flex is <em>not</em></strong>:</p>
<ul>
<li>It is certainly <em>not</em> <a href="http://www.gnu.org/software/flex/manual/" title="Fast Lexical Analyzer Generator">a tool for generating lexical analysers</a> ;¬)</li>
<li>It&#8217;s <em>not</em> “the new version of <a href="http://www.adobe.com/products/flash/" title="Adobe's official web page for Flash">Flash</a>” (<abbr title="Formerly Known As">FKA</abbr> “Macromedia Flash”). Development of Flash is on-going and the two products coexist. Flex hasn&#8217;t replaced (and won&#8217;t replace) Flash anytime soon, the reason for that being that&hellip;</li>
<li>&hellip;Flex is <em>not</em> “an alternative to Flash”. Sorry to disappoint you, but Flex is <em>not</em> a way to get rid of the dependence on the <a href="http://www.adobe.com/products/flashplayer/" title="Adobe's official web page for Flash Player">Flash Player</a>. Actually Flex is built on top of Flash and needs Flash Player to run.</li>
<li>It&#8217;s <em>not</em> a technology to build large, native apps that need to work close to the underlying platform or which performance needs to be optimised (read below to see why I believe this).</li>
</ul>
<p><strong>Flex in a nutshell (a rather small nutshell):</strong></p>
<p>Flex is an attempt by <a href="http://www.adobe.com/" title="Adobe's web site">Adobe</a> to make Flash attractive to, and suitable for, many software developers who were disregarding Flash as something not serious enough to use for developing “proper software”. Adobe has done a praiseworthy effort in that sense and has brought Flash to the realm of <abbr title="object-oriented">OO</abbr> programming. Adobe used <a href="http://www.eclipse.org/" title="The Eclipse development platform">Eclipse</a> to develop <a href="http://www.adobe.com/products/flex/features/flex_builder/" title="Adobe's official web page for Flex Builder">Flex Builder</a>. Flex Builder alone does a lot to make old-skool software developers feel at home &mdash; it&#8217;s a proper <abbr title="Integrated Development Environment">IDE</abbr> with all the features you would expect, plus the extensibility (and the slowness, I&#8217;m afraid) of Eclipse.</p>
<p>Flex developers use the Flex <abbr title="Software Development Kit">SDK</abbr> (command line compilers and component class library; free as in “freedom”) and the Flex Builder (the IDE) to build their applications. Flex apps are written mainly in two languages:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/ActionScript" title="In WP">Actionscript</a>, an ECMAScript-based language that exists since the first Flash Player.</li>
<li><a href="http://en.wikipedia.org/wiki/MXML" title="In WP">MXML</a>, a loose, proprietary implementation of <abbr title="Extensible Markup Language">XML</abbr> used to define <abbr title="Graphical User Interface">GUI</abbr> elements.</li>
</ul>
<p>The output of a Flex project is one or more Flash files (<code>.swf</code>). In terms of the approach to the development process, the single most important change from Flash to Flex is probably <strong>removing the “movie” way of thinking</strong>. Flash animators are used to the “movie paradigm” in which the time is an essential concept. In their animations they have been working with key concepts like “timeline”, “frame” and “loop”. Flex abandons that approach.</p>
<p>I have found that, in general, software developers without any experience with Flash get used to Flex even faster than Flash designers who don&#8217;t know much about programming.</p>
<p><strong>What Flex is good at:</strong></p>
<ul>
<li><strong>Rendering cool interfaces.</strong> Animations, transitions, effects, gradients, reflections, customised skins, embedded movies, nice charts, changes in opacity, layouts that are resized well when their container is resized, etc. For a demo, check the <a href="http://examples.adobe.com/flex2/inproduct/sdk/explorer/explorer.html" title="Flex 2 Component Explorer">Flex 2 Component Explorer</a>.</li>
<li><strong>Working on all major desktops and web browsers and many mobile devices.</strong> <abbr title="Operating System">OS</abbr>&#8216;s: Windows, Mac OS, Linux and Solaris. Browsers: <abbr title="Internet Explorer">IE</abbr>, Gecko-based browsers, Safari, Opera. Mobile devices: many, and <a href="http://ilounge.com/index.php/news/comments/adobe-ceo-announces-flash-for-iphone/" title="Flash for the iPhone">more to come</a>.</li>
<li><strong>Keeping the same “look &#038; feel” everywhere.</strong> You can see the default Flex 2 “look &#038; feel” in the <a href="http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html" title="Flex 2 Style Explorer">Flex 2 Style Explorer</a>.</li>
<li><strong>Integrating and communicating with other Adobe formats.</strong> Flash movies, Acrobat documents, ColdFusion, Dreamweaver, etc.</li>
</ul>
<p><strong>What Flex is <em>not</em> good at:</strong></p>
<ul>
<li><strong>Computationally expensive software.</strong> As we saw before, Flex stresses GUI aesthetics, intuitive design, portability, compatibility with existing Flash files and other Adobe tools, easy deployment, etc. And it was aimed at the web (in spite of <a href="http://www.adobe.com/products/air/" title="Adobe's official web page for Air">Air</a>). So don&#8217;t expect it to be any good at doing system calls, invoking hardware drivers, messing with the network at low-level, fine-tuning loops to save cycles of <abbr title="Central Processing Unit">CPU</abbr>, dealing with gigabytes of data, delivering real-time, etc. Because Flex apps are deployed as Flash files, every Flex app “lives” inside the Flash security sandbox, which prevents it from accessing many of the resources of the computer. Also, Flash is a proprietary format that doesn&#8217;t run natively but is interpreted by the Flash Player. That extra layer of translation decreases the performance.</li>
<li><strong>Classic Flash stuff.</strong> Don&#8217;t bother to learn Flex if all you need to do is Flash banners and simple animations. For that you will need a timeline, drawing tools and accuracy at pixel-level. Flex is not designed for that.</li>
<li><strong>Being extrovert with its neighbours.</strong> I hear that even Air makes it quite difficult to launch an external executable from a Flex application.</li>
</ul>
<p>Now, the “hello world” is mandatory, so here it goes.</p>
<p>This application simply displays a customised greeting (it&#8217;s a “hello world” on steroids). We&#8217;ll make the GUI <em>inherit</em> from the layer that processes the information, in a “code-behind” manner.</p>
<p>First, the Actionscript class contained in the file <code>info/tripu/blog/flex/SimpleApp.as</code>. This class extends the standard <code>Application</code> class and defines what to do with data:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #004993;">info</span>.tripu.blog.flex <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.Alert;
    <span style="color: #0033ff; font-weight: bold;">import</span> mx.core.Application;
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> SimpleApp extends Application <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> greet <span style="color: #000000;">&#40;</span>who<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
            Alert.<span style="color: #004993;">show</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">'Hello, '</span> <span style="color: #000000; font-weight: bold;">+</span> who <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">'!'</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

</div>
<p>Second, the MXML application <code>HelloWorld.mxml</code>. It defines the GUI by using an instance of the class <code>SimpleApp</code> and adding a couple of visual controls to it. Notice how the <abbr title="Actionscript">AS</abbr> class that we created before is now used straight as an XML element:</p>
<div class="code-block">

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;tripu:SimpleApp</span> xmlns:tripu=<span style="color: #ff0000;">&quot;info.tripu.blog.flex.*&quot;</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> id=<span style="color: #ff0000;">&quot;user&quot;</span> text=<span style="color: #ff0000;">&quot;world&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Greet&quot;</span> click=<span style="color: #ff0000;">&quot;{greet (user.text)}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/tripu:SimpleApp</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</div>
<p>The result of compiling those two files in a Flex project is this Flash file, <code>HelloWorld.swf</code> (you&#8217;ll need Flash Player version 8 or above to see the embedded Flash object):</p>
<p><embed src="http://blog.tripu.info/wp-content/uploads/2008/03/helloworld.swf" quality="high" bgcolor="#869ca7" width="50%" height="100%" name="HelloWorld" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"><br />
</embed></p>
<hr />
<p><small><strong>Categories:</strong> <a href="http://blog.tripu.info/item/category/flex" title="View all posts in Adobe Flex" rel="category tag">Adobe Flex</a>, <a href="http://blog.tripu.info/item/category/computers" title="View all posts in Computers" rel="category tag">Computers</a>, <a href="http://blog.tripu.info/item/category/work" title="View all posts in Work" rel="category tag">Work</a>; <strong>Tags:</strong> </small></p>
<p><a href="http://blog.tripu.info/item/flex#comments">3 comments so far</a>        © 2006-2010 <a href="http://tripu.info">tripu</a>        <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/2.0/uk/80x15.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tripu.info/item/flex/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
