<?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>MadeInFlex &#187; Tips</title>
	<atom:link href="http://www.madeinflex.com/categoria/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.madeinflex.com</link>
	<description>Creando Soluciones RIA...</description>
	<lastBuildDate>Fri, 10 Sep 2010 05:04:37 +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>#flex101 SWF más ligeros, bin-release</title>
		<link>http://www.madeinflex.com/2010/02/05/flex101-swf-mas-ligeros-bin-release/</link>
		<comments>http://www.madeinflex.com/2010/02/05/flex101-swf-mas-ligeros-bin-release/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:05:11 +0000</pubDate>
		<dc:creator>Edgar Parada</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=1190</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Con este post comenzamos una serie de recomendaciones, tips y tutoriales enfocados a cubrir aquellos temas básicos de la tecnología Flex que esperamos sean de utilidad para los entusiastas de la plataforma.
Uno de los primeros tips que es importante conocer cuando hacemos aplicaciones con Flex utilizando Flex/Flash Builder es el manejo de los archivos de [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Con este post comenzamos una serie de recomendaciones, tips y tutoriales enfocados a cubrir aquellos <strong>temas básicos de la tecnología Flex</strong> que esperamos sean de utilidad para los entusiastas de la plataforma.</p>
<p>Uno de los primeros tips que es importante conocer cuando hacemos aplicaciones con <strong>Flex</strong> utilizando <strong>Flex/Flash Builder</strong> es el manejo de los archivos de salida. De forma automática cuando generamos un proyecto nuevo con la herramienta se crean varias carpetas: <em>bin-debug, html-template, src y libs.</em><br />
<span id="more-1190"></span></p>
<p><img src="http://www.madeinflex.com/wp-content/uploads/2010/02/imagen_1.jpg" alt="Proyecto Flex" title="Proyecto Flex" width="252" height="147" class="aligncenter size-full wp-image-1191" /></p>
<p>Es común encontrar por la red aplicaciones <strong>Flex</strong> de desarrolladores que al compilar sus proyectos por <em>descuido o desconocimiento</em> suben las aplicaciones <strong>SWF</strong> generadas en la carpeta bin-debug, esta versión contiene información adicional que es utilizada cuando utilizamos el comando <em>debug</em> de la herramienta.</p>
<p>La forma correcta de subir nuestras aplicaciones al servidor sería aprovechando las versiones generadas a partir del comando “<strong>Export Release Build</strong>”, ya que al no incluir esa información adicional su peso es considerablemente menor que la versión de depuración.</p>
<p><img src="http://www.madeinflex.com/wp-content/uploads/2010/02/imagen_2.jpg" alt="Export Release Build" title="Export Release Build" width="341" height="234" class="aligncenter size-full wp-image-1192" /></p>
<p>Tomemos como ejemplo una aplicación sencilla que contiene 3 componentes: <em>Button, TextInput y DataGrid</em>. Al compilar estar aplicación el <strong>SWF</strong> generado en la carpeta bin-debug tiene un peso de <strong>449 kb</strong>.</p>
<p><img src="http://www.madeinflex.com/wp-content/uploads/2010/02/imagen_3.jpg" alt="Debug Version" title="Debug Version" width="354" height="130" class="aligncenter size-full wp-image-1193" /></p>
<p>Ahora ejecutemos el comando <em>Project > Export Release Build</em>, el tamaño de la aplicación generada es de tan solo <strong>276 kb</strong>, siendo el ancho de banda uno de los recursos más preciados en las aplicaciones de Internet es importante tener cuidado con estos pequeños detalles.</p>
<p><img src="http://www.madeinflex.com/wp-content/uploads/2010/02/imagen_4.jpg" alt="Debug Version" title="Debug Version" width="351" height="126" class="aligncenter size-full wp-image-1194" /></p>
<p>Hace tiempo en algún taller de Flex recuerdo que utilicé el hashtag <strong>#flex101</strong> para hablar de los fundamentos de la tecnología, por lo que los invito a compartir sus mejores tips en Twitter a la cuenta de <a href="http://twitter.com/madeinflex">@madeinflex</a> no duden que en una entrada posterior merecerá que hagamos una compilación de los mejores.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2010/02/05/flex101-swf-mas-ligeros-bin-release/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>TurboBinding metadata tag</title>
		<link>http://www.madeinflex.com/2009/09/17/turbobinding-metadata-tag/</link>
		<comments>http://www.madeinflex.com/2009/09/17/turbobinding-metadata-tag/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 18:29:54 +0000</pubDate>
		<dc:creator>Sergi Dote Teixidor</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=948</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Es bien sabido que el proceso de data binding es uno de los más usados en flex. Aporta facilidad y rapidez en el desarrollo de aplicaciones Flex. La grandeza del Binding seguramente es nos permite pasar datos entre diferentes componentes y distintas capas de una manera sencilla.
Aunque nos aporta grandes ventajas, también hace falta recordar [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Es bien sabido que el proceso de data binding es uno de los más usados en flex. Aporta facilidad y rapidez en el desarrollo de aplicaciones Flex. La grandeza del Binding seguramente es nos permite pasar datos entre diferentes componentes y distintas capas de una manera sencilla.<br />
Aunque nos aporta grandes ventajas, también hace falta recordar que puede aportar grandes desventajas si se usa incorrectamente: memory leaks, disminución del rendimiento de la aplicación, etc. Estas desventajas vienen dadas sobretodo por el código que se genera al usar el binding.<br />
<span id="more-948"></span></p>
<p>Gracias a mi amigo Álex Albericio he dado con este <a href="http://elromdesign.com/blog/2009/07/11/turbobinding-metadata-provides-performence-gain-and-additional-functionality-over-the-binding-tag/">post</a> de Elad Elrom, que nos habla de su nueva implementación, el tag TurboBinding y que se incluye en su librería, <a href="http://code.google.com/p/eladlib/">eladlib</a>.</p>
<p>El metatag TurboBinding, además de ser una implementación &#8220;lightweight&#8221; del concepto de Binding (según el autor), aporta más opciones en cuanto a binding. Las opciones que nos describe el autor son:</p>
<ul>
<li>Remove binding: El binding se destruye automáticamente. Setteando la propiedad unwatchCounter con un entero, el binding se destruirá al ejecutarse n veces, tantas como hayamos determinado con este entero.</li>
<li>Two-way data binding: nos permite hacer bindings bidireccionales.</li>
<li>Call back method: nos permite determinar una función de callback para que se llame cuando se ejecute el binding relacionado.</li>
</ul>
<p>El autor, en este post, nos adjunta un ejemplo para ver una comparación de rendimiento entre BindingUtils, MXML Binding y TurboBinding. </p>
<p>Espero que os sea de ayuda, aún no he tenido tiempo de testearlo, pero pinta bastante bien. A ver que os parece.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2009/09/17/turbobinding-metadata-tag/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[PercentProxy] Metadata tag</title>
		<link>http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/</link>
		<comments>http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 15:00:30 +0000</pubDate>
		<dc:creator>Joan Garnet</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=925</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->La metadata, conocida en otros lenguajes como anotaciones, es una potente herramienta para comunicarse con Flex Builder que permite realizar un abanico de tareas que van desde la generación de código hasta chequeos especiales en tiempo de compilación pasando por integración con el sistema de autocompletado del IDE.
En esta entrada veremos el funcionamiento de la [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>La metadata, conocida en otros lenguajes como anotaciones, es una potente herramienta para comunicarse con Flex Builder que permite realizar un abanico de tareas que van desde la generación de código hasta chequeos especiales en tiempo de compilación pasando por integración con el sistema de autocompletado del IDE.<br />
En esta entrada veremos el funcionamiento de la anotación <code>PercentProxy</code>, con la cual podemos definir parámetros en unidades numéricas o porcentuales.</p>
<p><span id="more-925"></span></p>
<div class="toc">
<ol>
<li><a href="http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/#toc-sintaxis">Sintaxis</a></li>
<li><a href="http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/#toc-posicionamiento">Posicionamiento</a></li>
<li><a href="http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/#toc-descripcion">Descripción</a></li>
<li><a href="http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/#toc-ejemplo">Ejemplo</a></li>
</ol>
</div>
<h2 id="toc-sintaxis">Sintaxis</h2>
<p><code>[PercentProxy("propiedadPorcentual")]</code><br />
Argumentos:</p>
<ul>
<li><strong>propiedadPorcentual</strong> (obligatorio) es la versión de cálculo porcentual del getter/setter al que afecta.
</ul>
<h2 id="toc-posicionamiento">Posicionamiento</h2>
<p>Esta anotación debe situarse antes de la declaración de un getter/setter de tipo numérico.</p>
<h2 id="toc-descripcion">Descripción</h2>
<p>Este tag de metadata (indocumentado) es la solución a la falta de sobrecarga de métodos en el lenguaje ActionScript 3. Cuando el compilador se encuentra una declaración porcentual en MXML para un valor que debería ser numérico y la propiedad está marcada con la anotación <code>[PercentProxy]</code> internamente se crea la lógica necesaria para que la asignación apunte al setter que le toca.</p>
<h2 id="toc-ejemplo">Ejemplo</h2>
<p><strong>TestPercentProxy.mxml</strong></p>
<div class="igBar"><span id="lmxml-3"><a href="#" onclick="javascript:showPlainTxt('mxml-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">MXML:</span>
<div id="mxml-3">
<div class="mxml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?<span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:local=<span style="color: #ff0000;">"*"</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;local:DataGridColumnPorcentualSize</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headerText=<span style="color: #ff0000;">"Col 1"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width=<span style="color: #ff0000;">"15%"</span><span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;local:DataGridColumnPorcentualSize</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headerText=<span style="color: #ff0000;">"Col 2"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width=<span style="color: #ff0000;">"15%"</span><span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;local:DataGridColumnPorcentualSize</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headerText=<span style="color: #ff0000;">"Col 3"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width=<span style="color: #ff0000;">"70%"</span><span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>DataGridColumnPorcentualSize.as</strong></p>
<div class="igBar"><span id="lactionscript3-4"><a href="#" onclick="javascript:showPlainTxt('actionscript3-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript 3:</span>
<div id="actionscript3-4">
<div class="actionscript3">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #9900cc; font-weight: bold;">package</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">setTimeout</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.DataGrid;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.dataGridClasses.DataGridColumn;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> mx.core.mx_internal;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; use <span style="color: #004993;">namespace</span> mx_internal;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> DataGridColumnPorcentualSize <span style="color: #0033ff; font-weight: bold;">extends</span> DataGridColumn</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> DataGridColumnPorcentualSize<span style="color: #000000;">&#40;</span> columnName:<span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span> columnName <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>PercentProxy<span style="color: #000000;">&#40;</span> <span style="color: #990000;">"widthPercent"</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">override</span> <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">width</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #004993;">Number</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">width</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">override</span> <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">width</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span>:<span style="color: #004993;">Number</span> <span style="color: #000000;">&#41;</span>:<span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">width</span> = <span style="color: #004993;">value</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> widthPercent<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #004993;">Number</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> dg:DataGrid = owner <span style="color: #0033ff; font-weight: bold;">as</span> DataGrid;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #000000; font-weight:bold;color:#800000;">100</span> * <span style="color: #000000;">&#40;</span> dg.columnCount / dg.<span style="color: #004993;">width</span> <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> widthPercent<span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span>:<span style="color: #004993;">Number</span> <span style="color: #000000;">&#41;</span>:<span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setWidth<span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span> <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> setWidth<span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span>:<span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span>:<span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>owner<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> dg:DataGrid = owner <span style="color: #0033ff; font-weight: bold;">as</span> DataGrid;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">width</span> = dg.<span style="color: #004993;">width</span> * <span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span> / <span style="color: #000000; font-weight:bold;color:#800000;">100</span> <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><span style="color: #0033ff; font-weight: bold;">else</span><span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Esto está lejos de ser lo más correcto </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// pero esto SOLO es un ejemplo...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">setTimeout</span><span style="color: #000000;">&#40;</span> setWidth, <span style="color: #000000; font-weight:bold;color:#800000;">100</span>, <span style="color: #004993;">value</span> <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La clase <code>DatGridColumn</code> que viene en el SDK de Flex no permite asignar los anchos de las columnas porcentualmente (por buenas razones). Para ilustrar el uso de la anotación en cuestión se puede ver en la clase <code>DataGridColumnPorcentualSize</code> la lógica añadida para que se soporte este tipo de asignación.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2009/09/14/percentproxy-metadata-tag/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[ArrayElementType] Metadata tag</title>
		<link>http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/</link>
		<comments>http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 07:00:07 +0000</pubDate>
		<dc:creator>Joan Garnet</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=900</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->La metadata, conocida en otros lenguajes como anotaciones, es una potente herramienta para comunicarse con Flex Builder que permite realizar un abanico de tareas que van desde la generación de código hasta chequeos especiales en tiempo de compilación pasando por integración con el sistema de autocompletado del IDE.
En esta entrada veremos el funcionamiento de la [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>La metadata, conocida en otros lenguajes como anotaciones, es una potente herramienta para comunicarse con Flex Builder que permite realizar un abanico de tareas que van desde la generación de código hasta chequeos especiales en tiempo de compilación pasando por integración con el sistema de autocompletado del IDE.<br />
En esta entrada veremos el funcionamiento de la anotación <code>ArrayElementType</code>, con la cual podemos definir Arrays tipados en MXML.</p>
<p><span id="more-900"></span></p>
<div class="toc">
<ol>
<li><a href="http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/#toc-sintaxis">Sintaxis</a></li>
<li><a href="http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/#toc-posicionamiento">Posicionamiento</a></li>
<li><a href="http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/#toc-descripcion">Descripción</a></li>
<li><a href="http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/#toc-ejemplo">Ejemplo</a></li>
<li><a href="http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/#toc-conclusion">Conclusión</a></li>
</ol>
</div>
<h2 id="toc-sintaxis">Sintaxis</h2>
<p><code>[ArrayElementType("elementType")]</code><br />
Argumentos:</p>
<ul>
<li><strong>elementType</strong> (obligatorio) es un nombre de clase completo. ej: <code>com.madeinflex.Usuario</code></li>
</ul>
<h2 id="toc-posicionamiento">Posicionamiento</h2>
<p>Esta anotación debe situarse antes de la declaración de una variable de tipo <code>Array</code>.</p>
<h2 id="toc-descripcion">Descripción</h2>
<p>La anotación en cuestión permite definir el tipo de dato de los elementos que son aceptados en un <code>Array</code>.<br />
Esta funcionalidad solo está disponible en Flex Builder en tiempo de compilación y cuando declaramos dicho <code>Array</code> mediante MXML.</p>
<h2 id="toc-ejemplo">Ejemplo</h2>
<p><strong>Ejemplo.mxml</strong></p>
<div class="igBar"><span id="lmxml-8"><a href="#" onclick="javascript:showPlainTxt('mxml-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">MXML:</span>
<div id="mxml-8">
<div class="mxml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&lt;?xml version = <span style="color: #ff0000;">"1.0"</span> encoding = <span style="color: #ff0000;">"utf-8"</span>?<span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:mx = <span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:local = <span style="color: #ff0000;">"*"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:madeinflex = <span style="color: #ff0000;">"com.madeinflex.*"</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;local:ListaUsuarios</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;local:usuarios</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;madeinflex:Usuario</span> uid = <span style="color: #ff0000;">"5"</span> nombre = <span style="color: #ff0000;">"Carlos Rovira"</span> <span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;madeinflex:Usuario</span> uid = <span style="color: #ff0000;">"6"</span> nombre = <span style="color: #ff0000;">"Xavi Beumala"</span> <span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;madeinflex:Usuario</span> uid = <span style="color: #ff0000;">"6"</span> nombre = <span style="color: #ff0000;">"Albero Albericio"</span> <span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/local:usuarios</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/local:ListaUsuarios</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>com/madeinflex/Usuario.as</strong></p>
<div class="igBar"><span id="lactionscript3-9"><a href="#" onclick="javascript:showPlainTxt('actionscript3-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript 3:</span>
<div id="actionscript3-9">
<div class="actionscript3">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #9900cc; font-weight: bold;">package</span> com.madeinflex<span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Usuario<span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> nombre:<span style="color: #004993;">String</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> uid:<span style="color: #004993;">int</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>ListaUsuarios.mxml</strong></p>
<div class="igBar"><span id="lmxml-10"><a href="#" onclick="javascript:showPlainTxt('mxml-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">MXML:</span>
<div id="mxml-10">
<div class="mxml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&lt;?xml version = <span style="color: #ff0000;">"1.0"</span> encoding = <span style="color: #ff0000;">"utf-8"</span>?<span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VBox</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:mx = <span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; width = <span style="color: #ff0000;">"400"</span> height = <span style="color: #ff0000;">"300"</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #339933;">&lt;mx:Script&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [Bindable]</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ArrayElementType( &quot;com.madeinflex.Usuario&quot; )]</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public var usuarios:Array;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/mx:Script&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> text = <span style="color: #ff0000;">"Hay { usuarios.length } usuarios"</span> width = <span style="color: #ff0000;">"100%"</span> <span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:List</span> labelField = <span style="color: #ff0000;">"nombre"</span> dataProvider = <span style="color: #ff0000;">"{ usuarios }"</span> width = <span style="color: #ff0000;">"100%"</span> <span style="color: #7400FF;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:VBox</span><span style="color: #7400FF;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Si modificamos <strong>Ejemplo.mxml</strong> y añadimos un elemento de cualquier tipo que no sea <code>Usuario</code>, por ejemplo un String, obtendremos un error diciendo algo como: <em>"In initializer for usuarios': type String not assignable to target Array element type"</em>:<br />
<img src="http://www.madeinflex.com/wp-content/uploads/2009/08/EjemploError.png" alt="Ejemplo de Error" title="EjemploError" width="462" height="133" class="alignnone size-full wp-image-945" /></p>
<h2 id="toc-conclusion">Conclusión</h2>
<p>Es un buen ejemplo de integración con Flex Builder a través de metadata pero la funcionalidad en si realmente no es demasiado útil ya que solo funciona para código MXML y en tiempo de compilación.<br />
<em>Nota: Si se requiere tener Arrays tipados en tiempo de ejecución ver la clase <code><a href="http://livedocs.adobe.com/flex/3/langref/Vector.html">__AS3__.vec.Vector</a></code> disponible a partir de Flash Player 10.</em></p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2009/08/07/arrayelementtype-metadata-tag/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Breakpoints condicionales</title>
		<link>http://www.madeinflex.com/2009/03/05/breakpoints-condicionales/</link>
		<comments>http://www.madeinflex.com/2009/03/05/breakpoints-condicionales/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 00:35:13 +0000</pubDate>
		<dc:creator>Joan Garnet</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2009/03/05/breakpoints-condicionales/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Existe una función flash.debugger.enterDebugger() (no documentada de momento) que permite, durante una sesión de debug, parar la ejecución de la aplicación para ser inspeccionada de la misma forma que lo haría un breakpoint.
Esta función nos puede ser útil, por ejemplo, en situaciones en las que queremos validar un comportamiento del que no logramos aislar la [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Existe una función <code>flash.debugger.enterDebugger()</code> (no documentada de momento) que permite, durante una sesión de debug, parar la ejecución de la aplicación para ser inspeccionada de la misma forma que lo haría un breakpoint.<br />
Esta función nos puede ser útil, por ejemplo, en situaciones en las que queremos validar un comportamiento del que no logramos aislar la causa. Añadiendo la llamada a la función dentro de un bloque condicional nos podemos ahorrar teclear F5, F6 y F8 un montón de veces, dejando que sea la misma aplicación la que decida cuando debe parar.<br />
<span id="more-794"></span><br />
Un ejemplo de uso:</p>
<div class="igBar"><span id="lmxml-12"><a href="#" onclick="javascript:showPlainTxt('mxml-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">MXML:</span>
<div id="mxml-12">
<div class="mxml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?<span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> creationComplete=<span style="color: #ff0000;">"test()"</span><span style="color: #7400FF;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #339933;">&lt;mx:Script&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import flash.debugger.enterDebugger;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private var cont:uint = 0;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private function test():void {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cont++;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( cont&gt; 5 ) {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enterDebugger();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; trace(&quot;Ejecutado test() &quot;+ cont +&quot; veces&quot;);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callLater( test );</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/mx:Script&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
En el caso de que no estemos en sesión de debug la función simplemente no hace nada, lo cuál resulta muy cómodo.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2009/03/05/breakpoints-condicionales/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ordenar Datagrid por fecha</title>
		<link>http://www.madeinflex.com/2008/06/13/ordenar-datagrid-por-fecha/</link>
		<comments>http://www.madeinflex.com/2008/06/13/ordenar-datagrid-por-fecha/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 08:51:44 +0000</pubDate>
		<dc:creator>ripoblet</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2008/06/13/ordenar-datagrid-por-fecha/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Comienzo mi posteo en este gran sitio con una respuesta que realicé en la lista de correos de madeinflex.
Consideremos que tengo un un datagrid que recibe un ArayCollection como Dataprovider, el campo de fecha se llama FECHA y se encuentra en el formato "dd/mm/yyyy hh24:mi" por ejemplo ahora cuando escribo este correo es: "11/06/2008 09:24" [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Comienzo mi posteo en este gran sitio con una respuesta que realicé en la lista de correos de madeinflex.<br />
Consideremos que tengo un un datagrid que recibe un ArayCollection como Dataprovider, el campo de fecha se llama FECHA y se encuentra en el formato "dd/mm/yyyy hh24:mi" por ejemplo ahora cuando escribo este correo es: "11/06/2008 09:24" , ahora si la fecha que tienes es sin horas, más simple aún.</p>
<p>La solución será utilizar una función llamada "sortFechas" sea capaz de comparar las fechas.<br />
<span id="more-683"></span></p>
<p>En la columna del datagrid coloca la funcion que realizará la comparación entre tipos de datos de fecha correctos, es decir "date". Sin embargo como mi dataprovider tiene la fecha como "String", debo transformarla en formato "Date" para así poder utilizar una función de comparación de la clase ObjectUtil llamada "dateCompare".</p>
<p>Primero creamos la funcion que transformará la fecha en formato string a la fecha en formato date, la llamaremos "String2Date". (No explicaré la función, pero no es nada difícil de entender, lo básico en cortar con split el string).</p>
<ul>
<li>Primero creamos la funcion que transformará la fecha en formato string a la fecha en formato date, la llamaremos "String2Date".</li>
<li>Segundo creamos la funcion que hará la comparación de fechas en formato date, llamada "sortFechas"</li>
<li>Indicamos a la columna del datagrid cómo ordenar la columna conla propiedad "sortCompareFunction"</li>
</ul>
<p>En un ejemplo completo :</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="400" height="600" id="ftf_wp" align="middle">
		  <param name="movie" value="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=400&h=600&file=http://www.madeinflex.com/index.php&ftf=true&postID=683&no=0&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="400" height="600" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=400&h=600&file=http://www.madeinflex.com/index.php&ftf=true&postID=683&no=0&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object><br />
El código fuente está aquí <a rel="attachment wp-att-692" href="http://www.madeinflex.com/2008/06/13/ordenar-datagrid-por-fecha/ordenarfechasendatagridzip/">ordenarfechasendatagrid.zip</a></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal">Si tiene una fecha más simple como por ejemplo DD/MM/YYYY entonces es más fácil y sólo modifiquen la funcion "String2Date"</p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal">Espero que les sirva, saludos a todos.</p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal">ripoblet</p>
<p></datagridcolumn></datagrid></application</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2008/06/13/ordenar-datagrid-por-fecha/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Protocolos de comunicación</title>
		<link>http://www.madeinflex.com/2008/06/12/protocolos-de-comunicacion/</link>
		<comments>http://www.madeinflex.com/2008/06/12/protocolos-de-comunicacion/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 09:17:43 +0000</pubDate>
		<dc:creator>Aritz Oruesagasti</dc:creator>
				<category><![CDATA[Artículos]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2008/06/12/protocolos-de-comunicacion/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Es conocido que Flex ofrece diversas formas para la comunicación con el servidor: HttpService, WebServices, RemoteObject, Image, FileReference, Mensajería... pero cuáles son los protocolos que se emplean por detrás? Cuántos protocolos se pueden utilizar en Flex? Cuál es la diferencia entre AMF, HTTP y RTMP? Este post pretende aclarar estas y otras cuestiones sobre los [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Es conocido que Flex ofrece diversas formas para la comunicación con el servidor: HttpService, WebServices, RemoteObject, Image, FileReference, Mensajería... pero cuáles son los protocolos que se emplean por detrás? Cuántos protocolos se pueden utilizar en Flex? Cuál es la diferencia entre AMF, HTTP y RTMP? Este post pretende aclarar estas y otras cuestiones sobre los protocolos de comunicación utilizados por Flex.</p>
<h3 id="toc-protocolos-soportados-por-flex">Protocolos soportados por Flex</h3>
<p>Flex soporta sólo dos protocolos de comunicaciÃƒâ€ºn: HTTP y RTMP. Realmente, utilizando Sockets puede llegar a soportar cualquier protocolo, pero fuera de HTTP y RTMP (con sus sucedáneos:HTTPS, etc.), toda la implementación del protocolo la tiene que hacer el usuario.</p>
<p><span id="more-689"></span></p>
<h3 id="toc-http-hypertext-transfer-protocol">HTTP (Hypertext Transfer Protocol)</h3>
<p>Es el protocolo de Internet por excelencia. Su puerto por defecto es el 80. Los datos que se transmiten van en formato plano. La gran ventaja sobre RTMP, es que ofrece la seguridad de que ningún firewall de ninguna empresa va a ser obstáculo.</p>
<p>La desventaja que tiene es que es un protocolo unidireccional. No permite el data-push por parte del servidor al cliente. Se puede intentar emular esta capacidad con la técnica conocidad como polling, que no es más que hacer que el cliente le pregunte cada cierto tiempo al servidor si hay alguna novedad o no. Esta técnica puede incrementar de forma considerable el tráfico en la red.</p>
<p>Estos son los componentes que utilizan el protocolo HTTP: HTTPService (métodos GET, POST, HEAD, OPTIONS, PUT, TRACE, y DELETE), WebService (SOAP encapsulado en HTTP), FileReference (método POST para subir y bajar ficheros, tambiÃƒË†n GET para el paso de parámetros) e Image.</p>
<p>También se utiliza HTTP en los distintos servicios del Adobe LifeCycle Data Services (LCDS en adelante), dependiendo del canal escogido (ver apartado AMF).</p>
<p>HTTPS (Hypertext Transfer Protocol over Secure Socket Layer, la versión segura de HTTP), es otra de las opciones a la hora de intercambiar datos con el servidor. Su puerto por defecto es el 443.</p>
<h3 id="toc-rtmp-real-time-messaging-protocol">RTMP (Real Time Messaging Protocol)</h3>
<p>Protocolo propietario de Adobe. Puerto por defecto: 1935</p>
<p>Ofrece dos grandes ventajas:</p>
<ul>
<li>Permite data-push desde el servidor al cliente.</li>
<li>Permite el streaming de audio, video y datos en Internet (con LifeCycle Data Services sólo datos, con Flash Media Server audio, video y datos, con WebORB.NET también audio y video.</li>
<p>Su gran desventaja radica en que los firewalls de algunas empresas, por cuestiones de seguridad, pueden tener capado el puerto 1935 o directamente el protocolo.</p>
<p>Para solventar este problema sin perder la funcionalidad se desarrolló RTMPT (Real Time Messaging Protocol Tunneled). Este protocolo encapsula los datos RTMP en peticiones válidas HTTP, y por lo tanto, la comunicación se hace a través del puerto 80, superando el bloqueo de los firewalls. Lógicamente, requiere algo más de ancho de banda que el RTMP, por las cabeceras HTTP y puede ser algo más lento, sobretodo en el establecimiento de la conexión. Tanto LCDS como WebORB.NET soportan RTMPT. FluorineFx lo hará en la siguiente versión.</p>
<p>También existe la versión segura de RTMP (RTMP sobre Tranport Layer Security), llamada RTMPS, que tiene al mismo problema con los firewalls que su versión no segura. Por ello, se pueden encapsular los datos RTMP en HTTPS. A esto se le llama RTMPS tunneled.</p>
<p>El protocolo RTMP lo emplea el bus de mensajería de LCDS, si el usuario escoge un canal RTMP.</p>
<h3 id="toc-amf-action-message-format">AMF (Action Message Format)</h3>
<p>Protocolo binario de Adobe que va por la versión AMF3 (han publicado recientemente su especificación). Aunque por el nombre de la versión pueda parecer que existan 3 cabe destacar que sólo existen dos: AMF0 y AMF3. Una de las mayores diferencias o mejoras que aporta AMF3 es que soporta datos binarios (ByteArray) y int, datos no soportados por AMF0 debido a que en la época que apareció el formato, Flash Player no soportaba estos tipos de datos.</p>
<p>AMF3 no es un protocolo para transferir información (como sÃƒÅ’ lo son HTTP y RTMP), sino que representa el formato en el que se transmite la información, en este caso un formato binario. El AMFGateway que se encuentra en LCDS (y sucedáneos) serializan y deserializan automáticamente los objetos debidamente serializados desde FlashPlayer.</p>
<p>Utilizando LCDS (o similares), todos los mensajes/llamadas, con RemoteObject, FlexMessaging y DataManagementeServices van en formato AMF. Puede ser AMF sobre HTTP o AMF sobre RTMP. Es decir, en los ficheros XML de configuración de estos servicios (remoting-config.xml, mesagging-config.xml, etc.), cuando se definen canales, el usuario escoge entre HTTP y RTMP, aunque el nombre de los canales disponibles sea:</p>
<ul>
<li>mx.messaging.channels.AMFChannel : AMF3 sobre HTTP</li>
<li>mx.messaging.channels.RTMPChannel : AMF3 sobre RTMP</li>
<li>mx.messaging.channels.SecureAMFChannel : AMF3 sobre HTTPS.</li>
<li>mx.messaging.channels.SecureRTMPChannel : AMF3 sobre RTMPs</li>
<li>mx.messaging.channels.SecureHTTPChannel : Datos en formato texto sobre HTTPS.</li>
</ul>
<h3 id="toc-sockets">Sockets</h3>
<p>Los socket permiten al usuario crear cualquier conexión con cualquier protocolo (que el servidor pueda atender, claro). Eso sí, implementándolo de forma manual. Se puede crear una aplicación Flex que sea un cliente FTP, o que se conecte a servicios como POP3, IMAP y SMTP. Pero lo dicho, es el usuario quién tiene que gestionar todo y cumplir lo que establezca el protocolo.</p>
<p>Bueno, pues hasta aquí con los protocolos en Flex. Espero haber aclarado un poco este tema. Y seguro que podemos ir completando la información con los comentarios.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2008/06/12/protocolos-de-comunicacion/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Tres puntos a recordar al crear una libreria</title>
		<link>http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/</link>
		<comments>http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 22:56:37 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[Artículos]]></category>
		<category><![CDATA[Componentes]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Utilizando compc o bien, desde FlexBuilder, podemos crear librerías de código en ActionScript y/o mxml que luego podemos distribuir en formato .swc a terceros ya sea por comodidad, porque nos dedicamos a vender librerías de código, porque es una forma de paquetizar conocimiento, fomentar la reutilización o por cualquier otro motivo.
La cuestión es que para [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Utilizando <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html">compc</a> o bien, desde FlexBuilder, podemos <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=projects_7.html">crear librerías de código</a> en ActionScript y/o mxml que luego podemos distribuir en formato .swc a terceros ya sea por comodidad, porque nos dedicamos a vender librerías de código, porque es una forma de paquetizar conocimiento, fomentar la reutilización o por cualquier otro motivo.</p>
<p>La cuestión es que para que la librería se vea lo mejor acabada y profesional posible deberíamos considerar siempre los siguientes puntos:</p>
<ul>
<li><a href="http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/#toc-desvincular-la-sdk-de-flex">Desvincular la SDK de Flex</a></li>
<li><a href="http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/#toc-crear-un-manifestxml">Crear un manifest.xml</a></li>
<li><a href="http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/#toc-crear-un-designxml">Crear un design.xml</a></li>
</ul>
<p><span id="more-682"></span><br />
<br/></p>
<h3 id="toc-desvincular-la-sdk-de-flex">Desvincular la SDK de Flex</h3>
<p>Es muy probable que en tu librería exista alguna referencia a cualquier clase de la SDK de Flex, ya sea debido a que alguno de tus componentes hereda de alguno de los base, porque utilizas alguno de sus managers o clases de utilidad o bien porque has paquetizado algun mxml en ella. En cualquier da estos casos, el linkador, detectará las dependencias directas de tus clases con las de la SDK. Este proceso será un proceso en cascada que detectará todas las interrelaciones incluso dentro de la misma SDK. Por ejemplo, si estas paquetizando una clase que no tiene nada, que simplemente herede de mx.controls.Button tu librería pesará entorno a los 200K debido a las dependencias que tiene Button con todo el resto del framework. Todas estas clases se añadirán pues a tu librería.</p>
<p><b>NOTA:</b> Esto no es una forma de reducir el tamaño final de los swf's</p>
<p>El concepto es correcto, pero el 99% de los usuarios que utilicen tus librerias no van a necesitar esas clases ya que cuando compilen sus proyectos con tu librería igualmente tendrán las clases de la SDK (resultando con el mismo tamaño final).</p>
<p>Por lo tanto podemos hacer que no se incluyan las dependencias de la SDK en la librería. A priori no notaremos una gran mejora en los tiempos de compilacion (aunque un poquito sí). Si estamos distribuyendo la libreria entonces sí que podemos ahorrar un poco de ancho de banda y mejorar los tiempos de descarga.</p>
<p>Para no añadir la SDK a la librería, en FlexBuilder, tenemos que ir a las propiedades del proyecto > "Flex Library Build Path" > "Library Path". Ahi cambiamos la opcion "Link Type" de framework.swc para que sea "External".</p>
<p><img src="/img/entries/libCreation1.png"/></p>
<p><br/></p>
<h3 id="toc-crear-un-manifest-xml">Crear un manifest.xml</h3>
<p>Tomando como ejemplo los componentes paquetizados en la SDK de Flex, siempre que añadimos uno a un .mxml el componente se instancia con una sintaxis parecida a &lt;mx:Button /&gt; siendo el único namespace que se usa siempre <b>mx</b>. En cambio cuando hacemos nuestras propias librerias siempre se utiliza como namespace la última parte del package donde se encuentra el componente que estamos instanciando. De esta forma si tenemos componentes en paquetes distintos i.e: com.madeinflex.package1 y com.madeinflex.package2 se nos instanciaran los componentes de la forma &lt;package1:Componente1 /&gt; o &lt;package2Componente2 /&gt;.</p>
<p>La verdad es que luego, el uso de la librería, es bastante molesto ya que se terminan declarando un sinfín de namespaces en el xml que ensucia bastante el código. Por otro lado no se puede saber con un simple vistazo a qué librería pertenece un componente concreto. Se tiene que ir a la definición del namespace, mirar cuál es su package y luego ponerle un poco de imaginación.</p>
<p>Para solventar esto FlexBuilder y compc ponen a nuestra disposicion los manifest, asociados a un namespace. Un manifest no es mas que un fichero xml en el que se declaran, en la forma clave / valor, los componentes contenidos en una librería. Por ejemplo:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="550" height="130" id="ftf_wp" align="middle">
		  <param name="movie" value="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=550&h=130&file=http://www.madeinflex.com/index.php&ftf=true&postID=682&no=0&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="550" height="130" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=550&h=130&file=http://www.madeinflex.com/index.php&ftf=true&postID=682&no=0&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<p>En FlexBuilder, para asociar un fichero de manifest a un namespace lo tenemos que hacer a través del panel de propiedades del proyecto. En el subapartado "Flex Library Compiler" definiremos el namespace y le vincularemos el fichero. Si declaramos que el nombre de espacios sea http://www.madeinflex.com/mif entonces podremos instanciar los componentes de la siguiente forma:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="550" height="80" id="ftf_wp" align="middle">
		  <param name="movie" value="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=550&h=80&file=http://www.madeinflex.com/index.php&ftf=true&postID=682&no=1&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="550" height="80" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=550&h=80&file=http://www.madeinflex.com/index.php&ftf=true&postID=682&no=1&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<p>Destacar aquí que podemos definir el id de un componente con un nomre distinto al de su clase. </p>
<p><img src="/img/entries/libCreation2.png"/></p>
<p>Otra cosa a considerar cuando paquetizamos una libreria es que muy probablemente no queramos que el programador que la utilice tenga acceso o pueda visualizar todas las clases que hemos paquetizdo. Puede haber clases de utilidades, superclases, clases de soporte, etc. que deberían ser transparentes y no mostrarse al integrador. Si declaramos un manifest para la librería y no declaramos en él estas clases el code autocomplete no se las mostrara aunque si que estarán en la librería y por lo tanto todo compilará correctamente.</p>
<p><br/></p>
<h3 id="toc-crear-un-design-xml">Crear un design.xml</h3>
<p>Puede que esta funcionalidad haya pasado desapercibida para muchos pero creo que es imprescindible para terminar de paquetizar bién una libreria y darle el toque final.</p>
<p>Al definir el namespace http://www.madeinflex.com/mif, por defecto FlexBuilder al instanciar un componente suyo lo hace de la forma <madeinflex:Component1 xmlns:madeinflex="http://www.madeinflex.com/mif" />, es decir utilizando <em>madeinflex</em> como prefijo para el namespace en vez de <em>mif</em> o cualquier otro. Al hacer esto parece que no podamos asignar a un mismo dominio distintos namespaces. Pero la SDK de flex si que lo hace no? xmlns:mx="http://www.adobe.com/2006/mxml".</p>
<p>Este es uno de los objetivos que tiene el fichero design.xml, poder definir el prefijo que FlexBuilder utilizará por defecto al instanciar un componente de la librería.</p>
<p>Otro aspecto que podemos pulir un poco más tiene que ver con la perspectiva de diseóo dentro de Flex Builder. Para los que la habéis utilizado habréis visto que en la vista "Components" aparece un árbol jerárquico con los distintos componentes que se pueden arrastrar al mxml. Por defecto todos los componentes o clases que se puedan instanciar visualmente dentro del proyecto aparecerán en la categoría  <em>Custom</em>. Pues bién, a través del fichero design.xml podemos hacer que los distintos componentes paquetizados en una librería aparezcan jerarquizados como creamos más conveniente.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="550" height="300" id="ftf_wp" align="middle">
		  <param name="movie" value="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=550&h=300&file=http://www.madeinflex.com/index.php&ftf=true&postID=682&no=2&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="550" height="300" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=550&h=300&file=http://www.madeinflex.com/index.php&ftf=true&postID=682&no=2&def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<p>En este ejemplo estamos definendo que el prefijo para el namespace http://www.madeinflex.com/mif sea <em>mif</em> y tal como se ve en la figura, definimos dos categorias de componentes: MadeInFlex_1 y MadeInFlex_2 a las que asociamos respectivamente los componentes Component1 y Component2. Donde Component1 y Component2 son el atributo id del componente declarado en el manifest.xml.</p>
<p><img src="/img/entries/libCreation3.png"/></p>
<p>Para que estos cambios surjan efecto tenemos que forzar al compilador a añadir el fichero desing.xml a la librería. Para ello abrimos el panel de propiedades del proyecto >> Flex Library Build Path >> Assets y ahi marcamos tanto el manifest.xml como el design.xml. Esto hará que, aunque no sean ficheros referenciados desde el código y a los que por lo tanto el linker jamás llegaría, los añada al swc final.</p>
<p>Para rizar el rizo, podemos terminar de paquetizar nuestros componentes personalizando el icono que se utiliza en el árbol jerárquico. Para ello lo único que tenemos que hacer es utilizar el siguiente tag de metadatos en la clase que define el componente [IconFile("icono.png")]. Donde icono.png hace referencia al fichero que queremos utilizar como icono. El fichero referenciado se toma con una ruta relativa respecto a la clase que lo incluye. Destacar tambien que para que el icono se cargue éste se tiene que haber añadido a la compilacion (igual que hemos hecho con design.xml). Si se cambia el icono de una librería se tiene que reiniciar eclipse para que los cambios se vean reflejados. </p>
<p><img src="/img/entries/libCreation4.png"/></p>
<p>Te puedes <a href="/img/entries/eclipseLibraryProjects.zip">descargar aqui los proyectos utilizados</a> en los ejemplos.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2008/06/11/tres-puntos-a-recordar-al-crear-una-libreria/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Guía práctica de ActionScript 3.0</title>
		<link>http://www.madeinflex.com/2008/04/24/guia-practica-de-actionscript-30/</link>
		<comments>http://www.madeinflex.com/2008/04/24/guia-practica-de-actionscript-30/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 12:25:35 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2008/04/24/guia-practica-de-actionscript-30/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Este es el nombre del libro en el que hemos estado trabajando los últimos meses con Joseba y con Dani.
La verdad es que ha sido una experiencia genial, aunque hemos tenido bastante trabajo, invertido bastantes horas y bastantes reescrituras, me quedo sobretodo con la mucha ilusión y muchas ganas que hemos puesto en ello. Espero [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Este es el nombre del libro en el que hemos estado trabajando los últimos meses con <a href="http://www.sidedev.net/blog">Joseba</a> y con <a href="http://www.granatta.com">Dani</a>.</p>
<p>La verdad es que ha sido una experiencia genial, aunque hemos tenido bastante trabajo, invertido bastantes horas y bastantes reescrituras, me quedo sobretodo con la mucha ilusión y muchas ganas que hemos puesto en ello. Espero que lo disfruteis tanto como hemos hecho nosotros mientras lo escribíamos.</p>
<p>Aún y tratarse de un libro de nivel medio y no muy extenso (algo más de 300 páginas) hemos tratado de cubrir todos los aspectos relevantes que presenta ActionScript 3.0 de una forma amena y práctica.</p>
<p>El libro está enfocado tanto aquellos que quieran empezar como a aquellos que ya conocían AS.2 y quieran dar el salto a AS.3. Aunque estoy seguro que aquellos que ya trabajáis en AS3 encontraréis alguna cosa útil en él.</p>
<p>Los ejemplos están enfocados desde una vertiente Flash, pero la compatibilidad es 100% con Flex. Sin que se llegue a tratar específicamente nada concreto de Flex, lo podéis tomar igualmente como referencia de lenguaje.</p>
<p>Este es el índice del libro:</p>
<ol>
<li>Introducción a Actionscript</li>
<li>Variables y tipos de datos</li>
<li>Operadores</li>
<li>Estructuras de control</li>
<li>Programación Orientada a Objetos y Flash</li>
<li>Eventos</li>
<li>Estructuras de datos</li>
<li>Paquetes en el Flash API</li>
<li>Usando la Display List</li>
<li>Filtros en Flash CS3</li>
<li>Trabajo con campos de texto</li>
<li>XML</li>
<li>Efectos matemáticos</li>
<li>Transiciones en Flash CS3</li>
<li>Vídeo en Flash</li>
<li>Manejo de sonido en AS3</li>
<li>Papervision: 3D en Flash</li>
<li>Recursos y enlaces</li>
</ol>
<p>El libro aún no está a la venta, seguramente estará en las librerías en Junio, pero para que empeceis a hacer boca Anaya, gracias Eugenio!, nos ha dado permiso para distribuir <b>gratis el capítulo de XML y e4x. <a href="/img/entries/GuiaPracticaAS3_e4x_XML.pdf">Así que aquí lo teneis!</a></b>.</p>
<p>Si todo va bien, este será sólo el comienzo <img src='http://www.madeinflex.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2008/04/24/guia-practica-de-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Shortcuts, shortcuts, shortcuts&#8230;</title>
		<link>http://www.madeinflex.com/2008/04/10/shortcuts-shortcuts-shortcuts/</link>
		<comments>http://www.madeinflex.com/2008/04/10/shortcuts-shortcuts-shortcuts/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 15:19:41 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2008/04/10/shortcuts-shortcuts-shortcuts/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->No sé qué haría sin ellos! Creo que su utilidad está justificada antes de explicarlos pero por lo que voy viendo en las sesiones que hago y cursos hay aún shortcuts desconocidos en lo que refiere a Flex Builder.
Así que aquí va un pequeño resumen de los shortcuts sin los que no podría vivir:
ctrl + [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>No sé qué haría sin ellos! Creo que su utilidad está justificada antes de explicarlos pero por lo que voy viendo en las sesiones que hago y cursos hay aún shortcuts desconocidos en lo que refiere a Flex Builder.</p>
<p>Así que aquí va un pequeño resumen de los shortcuts sin los que no podría vivir:</p>
<p><b>ctrl + shift + R</b>: Abre una ventana en la que, usando search as you type, podemos localizar cualquier clase de los proyectos que tengamos abiertos. La gracia es que no tenemos que acordarnos del package, ni de la carpeta donde está. Además podemos usar wildcards por si ni tan siquiera recordamos el nombre exactamente.</p>
<p><b>ctrl + shitf + T</b>: En la misma linea que el anterior, pero perimite buscar clases de la SDK o de cualquier librería que tengamos referenciada en el proyecto. Este es muy útil para navegar por las clases de la SDK. </p>
<p><b>F3</b>: Tiene varias funciones dependiendo del contexto en el que nos encontremos. Si estamos editando una clase y tenemos el cursor encima del nombre de una clase, al pulsar F3, iremos al fichero de esa clase. Si el cursor está encima de una variable, el cursor se desplazará a la definición de esa variable. Si el cursor está encima de la invocación a un método se abrirá la clase y posicionará el cursor en la definición de ese método.<br />
<span id="more-657"></span><br />
<b>ctrl + click</b>: Si pulsamos la tecla control y movemos el ratón por encima de los elementos estos se mostrarán subrayados. Haciendo click navegaremos a la definición de ese elemento.</p>
<p><b>ctrl + shift + c</b>: Si tenemos un bloque de código seleccionado y pulsamos esta combinación , el código se comentará. </p>
<p><b>ctrl + shift + /</b>: Ídem pero con comentarios a nivel de linea. Ambos los podemos utilizar tanto para comentar como para descomentar.</p>
<p><b>ctrl + espacio</b>: Si estamos escribiendo el nombre de una variable, de un método o de un clase y pulsamos esta combinación, aparecerán las posibles opciones para autocompletar. Si sólo hay una opción directamente se autocompletará. En el caso de tratarse de una clase, si es necesario, se añadirá el import de forma automática. Si pulsamos esta combinación mientras editamos el package automáticamente se añadirá el package que toque correspondiente a la anidación de carpetas. </p>
<p><b>ctrl + shift + espacio</b>: Con el cursor, y en el contexto de una invocación a un método, nos aparecerá la firma del método que estamos invocando. De esta forma podemos ver qué es cada parámetro así como los nombres de los atributos.</p>
<p><b>shift + F2</b>: Si tenemos una propiedad, un método o una clase seleccionada se abrirá la documentación contextual de ese elemento.</p>
<p><b>ctrl + alt + g</b>: teniendo el cursor en un método, nos mostrará las referencias a ese método desde otras clases.</p>
<p><b>ctrl + o</b>: Editando una clase nos aparecerá un Outline de los métodos y atributos de esta. Es una ventana con funcionalidad search as you type, de tal forma que podremos escoger el punto del código al que queremos ir de forma muy fácil.</p>
<p><b>ctrl + shift + D</b>: Añade un bloque CDATA (sólo mientras editamos un mxml).</p>
<p><b>ctrl + f</b>: Abre la ventana de buscar y reemplazar texto. Yo normalmente y para mayor comodidad tengo las opciones de wrap search e incremental marcadas.</p>
<p><b>ctrl + j</b>: Lo mismo que antes pero sin abrir ninguna ventana. Tal cual empezamos a escribir el cursor irá cambiando de sitio.</p>
<p><b>ctrl + k</b>: Después de hacer una búsqueda (tanto con ctrl+f como con ctrl+j) nos posiciona en el siguiente resultado. Un uso que utilizo mucho es, seleccionar una palabra, y pulsar ctrl+K. Lo que hace es ir a la siguiente ocurrencia.</p>
<p><b>ctrl + shift + k</b>: Igual que el anterior pero en vez de buscar hacia adelante busca hacia atrás.</p>
<p><b>Mark ocurrences</b>: Ãƒâ€°ste no es un shortcut, pero ayuda muchísimo. Si tenemos activada la opción (ver imagen) tendremos siempre señalado en el código las ocurrencias del elemento que tengamos debajo del caret.</p>
<p><b>ctrl + d</b>: Elimina la linea donde esté posicionado el caret. Si tenemos varias selecionadas las borra todas.</p>
<p><b>ctrl + alt + {UP_ARROW | DOWN_ARROW}</b>: Duplica arriba o abajo las lineas que tengamos seleccionadas. Si no tenemos ninguna seleccionada duplica la linea donde esté el caret.</p>
<p><b>alt + {UP_ARROW | DOWN_ARROW}</b>: Mueve las lineas seleccionadas hacia arriba o hacia abajo. Muy bueno para reorganizar el código sin tener que andar copiando y pegando.</p>
<p><b>ctrl + F11</b>: Lanza en modo debug la última compilación que hayamos hecho.</p>
<p><b>ctrl + shift + F11</b>: Lanza en modo run la última compilación que hayamos hecho.</p>
<p><b>ctrl + b</b>: Si no tenemos la compilación automática activada (recomendable no tenerla) compila el código.</p>
<p><b>ctrl + alt + r</b>: Teniendo el caret encima del nombre de una variable, clase o método lanza un proceso de refactor a través del que podemos cambiar su nombre en todo el código (no sólo en la clase que esté abierta).</p>
<p><b>ctrl + alt + [LEFT_ARROW | RIGHT_ARROW]</b>: Cuando estamos editando código en varias clases, estas flechas permiten ir al punto anterior en el que se ha estado editando. Es como un deshacer de la posición del cursor entre clases.</p>
<p><b>ctrl + w</b>: Cierra la clase que estemos editando.</p>
<p><b>ctrl + shift + w</b>: Cierra todas las clases que tengamos abiertas.</p>
<p><b>ctrl + g</b>: Busca todas las declaraciones del tipo que tengamos debajo del caret.</p>
<p><b>ctrl + shift + g</b>: Busca todas las referencias del elemento que tengamos debajo del caret.</p>
<p><b>ctrl + m</b>:Maximiza el editor que tenga el foco en ese momento.</p>
<p><b>ctrl + L</b>: Ir a la linea que indiquemos.</p>
<p><b>ctrl + tab</b>: Nos permite movernos por las distintas clases que tengamos abiertas.</p>
<p><b>ctrl + shift + b</b>: Añade un break point en la línea donde esté el caret.</p>
<p><b>shit + enter</b>: Añadir una linea por debajo de la del caret y empezar a escribir (respetando el indentado).</p>
<p><b>ctrl + shift + enter</b>: Ídem que el anterior pero añadiendo la línea por encima.</p>
<p>Dejo para otro post los que tienen a ver con el Debug. </p>
<p>Si alguno de los shortcuts no os funciona o directamente no os convence la combinación de teclas recordad que las podéis modificar desde el panel de preferencias de Flex Builder en la sección "keys".</p>
<p>Para los que nos esteis acostumbrados a usarlos quizás os parezcan muchos, incluso demasiados, pero la verdad es que cuando uno se acostumbra la vida le es más fácil, e incluso los puede escribir de una atacada <img src='http://www.madeinflex.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>¿ Cuáles usais vosotros ?</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2008/04/10/shortcuts-shortcuts-shortcuts/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
