<?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; Flex Builder</title>
	<atom:link href="http://www.madeinflex.com/categoria/flex-builder/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.madeinflex.com</link>
	<description>Creando Soluciones RIA...</description>
	<lastBuildDate>Wed, 30 Nov 2011 16:04:06 +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>Flash Player 11, AIR 3 y Flash Builder 4.6</title>
		<link>http://www.madeinflex.com/2011/09/21/flash-player-11-air-3-y-flash-builder-4-6/</link>
		<comments>http://www.madeinflex.com/2011/09/21/flash-player-11-air-3-y-flash-builder-4-6/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 07:08:29 +0000</pubDate>
		<dc:creator>Sergi Dote Teixidor</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Noticias]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=2332</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Se ha hecho oficial el anuncio de Player 11, AIR 3, Flex 4.6 y  Flash Builder 4.6. Se estima que estarán disponibles a partir de octubre.
Os dejo a continuación dos links para que podáis haceros una idea de lo que esto implicará:
link 1
link 2]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Se ha hecho oficial el anuncio de Player 11, AIR 3, Flex 4.6 y  Flash Builder 4.6. Se estima que estarán disponibles a partir de octubre.<br />
Os dejo a continuación dos links para que podáis haceros una idea de lo que esto implicará:<br />
<a href="http://www.adobe.com/devnet/flex/articles/whats-new-flex-flash-builder-46.html">link 1</a><br />
<a href="http://blog.digitalbackcountry.com/2011/09/flash-player-11-air-3-and-flexflash-builder-4-6/">link 2</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2011/09/21/flash-player-11-air-3-y-flash-builder-4-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Operaciones CRUD desde Flex con Pimento y Cinnamon</title>
		<link>http://www.madeinflex.com/2010/11/27/operaciones-crud-desde-flex-con-pimento-y-cinnamon/</link>
		<comments>http://www.madeinflex.com/2010/11/27/operaciones-crud-desde-flex-con-pimento-y-cinnamon/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 10:44:08 +0000</pubDate>
		<dc:creator>Nono F. Carballo Escalona</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Noticias]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=1935</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->¿Qué es Pimento Data Services y qué funcionalidades ofrece?
El ejemplo
Conclusiones


¿Qué es Pimento Data Services y qué funcionalidades ofrece?
Cuando utilizamos JPA e Hibernate para ejecutar operaciones CRUD en nuestra aplicación creamos las entidades con sus correspondientes anotaciones, luego creamos una capa DAO en la cual invocamos las operaciones de persistencia y finalmente una capa de servicios [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p><span id="more-1935"></span><br />
<!--noteaser--></p>
<div class="toc">
<ol>
<li><a href="http://www.madeinflex.com/2010/11/27/operaciones-crud-desde-flex-con-pimento-y-cinnamon/#toc-que-es-pimento-data-services-y-que-funcionalidades-ofrece">¿Qué es Pimento Data Services y qué funcionalidades ofrece?</a></li>
<li><a href="http://www.madeinflex.com/2010/11/27/operaciones-crud-desde-flex-con-pimento-y-cinnamon/#toc-el-ejemplo">El ejemplo</a></li>
<li><a href="http://www.madeinflex.com/2010/11/27/operaciones-crud-desde-flex-con-pimento-y-cinnamon/#toc-conclusiones">Conclusiones</a></li>
</ol>
</div>
<h4 id="toc-que-es-pimento-data-services-y-que-funcionalidades-ofrece">¿Qué es Pimento Data Services y qué funcionalidades ofrece?</h4>
<p>Cuando utilizamos JPA e Hibernate para ejecutar operaciones CRUD en nuestra aplicación creamos las entidades con sus correspondientes anotaciones, luego creamos una capa DAO en la cual invocamos las operaciones de persistencia y finalmente una capa de servicios desde la cual invocamos los métodos del DAO y encapsulamos la lógica de negocios. Si ejecutamos todo este código en una aplicación JEE que implemente AMF podremos invocar estos métodos desde Flex utilizando Remote Objects. Pero en caso que decidamos dotar de más inteligencia a la aplicación Flex podemos trasladar la capa de servicios al cliente y en este caso necesitaríamos invocar directamente a la capa DAO o a las operaciones de persistencia.</p>
<p>Pimento Data Services nos permite, desde ActionScript, invocar las operaciones de persistencia definidas por JPA en el servidor, a través de la clase EntityManager, homóloga de la de JPA, pero adaptada a este tipo de cliente. A través de esta clase podemos invocar las operaciones “load”, “persist”, “remove” y “merge”, además de ejecutar consultas utilizando JPAQL y “Named Query”.</p>
<p>El framework almacena en un “cache” en el cliente las entidades cargadas del servidor, asegurando que exista una sola instancia de cada entidad, y este “cache” se utiliza para enviar al servidor solamente las propiedades que cambien cuando se realice una operación “merge” o para restablecer el estado original de la entidad, también ofrece métodos para eliminar objetos del “cache” e inspeccionar si un objeto ya existe en el “cache”.</p>
<p>Pimento ofrece también funcionalidades que permiten realizar “lazy loading” de entidades. Para todas las asociaciones y colecciones marcadas como “lazy” que no han sido inicializadas en el momento de la carga, el servidor envía solamente “proxies” al cliente, y en el momento necesario, utilizando el método “initialize” de la clase EntityManager se cargarán el resto de los datos.</p>
<p>Ante una operación “merge” de una entidad se compara el estado de la misma con la que se encuentra en el “cache” y se envía al servidor solamente aquellas propiedades que hayan cambiado, este proceso ocurre recursivamente cuando las propiedades son colecciones.</p>
<p>El framework también se ocupa de gestionar las llaves primarias de las entidades, al hacer persistente una nueva entidad se devuelve la misma entidad con el valor correspondiente de su llave primaria inyectada.</p>
<p>Si tenemos propiedades en nuestra entidad en el servidor que no deseamos que lleguen al cliente o que no sean modificadas en éste, anotamos las mismas usando anotaciones propias del framework.<br />
En el servidor podemos interceptar todas las operaciones iniciadas en el cliente y controlar el valor de las propiedades de las entidades involucradas en las operaciones.</p>
<p>Pimento Data Services se compone de dos partes, una se incluye en el cliente y otra en el servidor. La parte que se incluye en el servidor utiliza Spring para inyectar dependencias en todas las clases que reciben las entidades enviadas por el cliente. La parte correspondiente en el cliente incluye librerías que se añaden al proyecto.</p>
<p>El framework ofrece dos modelos de programación para trabajar con entidades persistentes: uno utilizando la clase EntityManager de AS3 y otro utilizando servicios personalizados, cada uno tiene sus ventajas y desventajas. El modelo más simple es el que utiliza el EntityManager de AS3, con este modelo creamos las entidades y le incluimos las anotaciones propias de JPA, luego añadimos la anotación “@Managed” a aquellas entidades que queremos que sean gestionadas por Pimento, se crean las clases AS3 equivalentes a las entidades gestionadas, se inicializa el cliente y se invocan las operaciones CRUD, opcionalmente se pueden crear interceptores.</p>
<p>Los servicios personalizados por su parte son equivalente a las capa de servicios que mencionábamos anteriormente, son clases Java gestionadas por Spring y que se exponen al cliente para que sean invocadas remotamente. El framework incluye tareas ant para generar los “proxies” de esas clases en el cliente.</p>
<p>Desde el punto de vista de flexibilidad los servicios personalizados son más convenientes si planeamos que nuestra aplicación tenga múltiples clientes (Web, de escritorio, Web Service, etc.), pero si el único cliente es Flex entonces la solución más simple es usar el EntityManager de AS3, en este caso solamente tenemos que crear en el servidor las entidades con sus anotaciones correspondientes.<br />
El framework se soporta sobre Cinnamon Remoting, una aplicación JEE que implementa el protocolo AMF3, como BlazeDS, pero a diferencia de éste no soporta mensajería, por lo que se hace un poco complejo implementar la sincronización de datos.</p>
<p>En este artículo veremos a través de un ejemplo como ejecutar operaciones CRUD desde Flex con Pimento Data Services utiizando el EntityManager de AS3. En artículos futuros veremos la funcionalidad de “lazy loading” y los servicios personalizados.</p>
<h4 id="toc-el-ejemplo">El ejemplo</h4>
<p>En el ejemplo que desarrollaremos partimos del hecho que queremos gestionar una entidad denominada User y contamos con un servidor de bases de datos MySQL. </p>
<p>Luego de descargar el framework desde <a href="http://www.spicefactory.org/pimento/download.php">aquí</a> lo primero que haremos será crear la aplicación JEE que utilice Cinnamon y donde crearemos las entidades. Para esto creamos un proyecto de tipo “Dynamic Web Project” con las siguientes características:</p>
<ul>
<li>Nombre del proyecto: PimentoServer</li>
<li>Target Runtime: En nuestro caso usaremos Apache Tomcat 6, pero puede utilizarse  cualquier otro que se haya configurado.</li>
<li>Versión del módulo Web Dinámico: 2.5</li>
<li>Configuración: Configuración por defecto para Apache Tomcat 6.0</li>
<li>Cambiamos la carpeta donde se compilarán las clases a “PimentoServer/WebContent/WEB-INF/classes”.</li>
</ul>
<p>Una vez creado el proyecto copiamos el contenido de la carpeta “server/web/WEB-INF/lib” de la distribución del framework en “WebContent/WEB-INF/lib” de nuestro proyecto. Sustituimos el archivo de HSQLDB por el controlador JDBC de MySQL, y copiamos de la carpeta “server/release” los archivos “cinnamon-core”, “cinnamon-reflect” y “pimento-core”. Necesitamos copiar también el paquete “javassist”, este lo podemos encontrar en la distribución de Spring con dependencias.</p>
<p>Creamos una carpeta denominada “config” dentro de “WebContent/WEB-INF” de nuestro proyecto y copiamos los archivos “jpa-spring.xml” y “pimento-spring.xml” en “server/web/WEB-INF/config” en la distribución del framework; también copiamos el archivo “dp.properties.template.mysql” de “server/web/WEB-INF/config/db-templates” como “db.properties” en “WebContent/WEB-INF/config” de nuestro proyecto y ajustamos los valores de la conexión a la base de datos. Como estamos en fase de desarrollo ponemos “hibernate.hbm2ddl.auto=update”.</p>
<p>Finalmente el archivo “web.xml” de nuestro proyecto queda así:</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=0&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=0&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>A continuación crearemos la entidad que vamos a gestionar desde el cliente:</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=1&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=1&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Aquí la única anotación propia de Pimento es “@Managed”, que indica que la entidad será gestionada por el framework, o sea, será incluida en el “cache” del cliente cuando sea cargada, su llave primaria será inyectada al hacer persistente una instancia de la clase, se enviarán solamente las propiedades que cambien al realizar una operación “merge” y su estado podrá ser gestionado a través del EntityManager.</p>
<p>Desplegamos la aplicación en Tomcat y arrancamos el servicio, pero antes creamos la base de datos según quedó configurada en el archivo “db.properties”. Al iniciar la aplicación se creará la tabla que representa la entidad en la base de datos. Llenamos esta tabla con información inicial para poder efectuar la autenticación en la UI.</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=2&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=2&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Esto es todo lo que haremos en el servidor, a continuación crearemos la UI.</p>
<p>Creamos un proyecto Flex con las siguientes características:</p>
<ul>
<li>Nombre del proyecto: PimentoClient</li>
<li>Tipo de aplicación: Web</li>
<li>Seleccionamos el SDK por defecto</li>
<li>Como tecnología del servidor no seleccionamos ninguna</li>
<li>Como carpeta de salida seleccionamos la carpeta WebContent del proyecto PimentoServer que creamos anteriormente.</li>
</ul>
<p>La interface de usuario contiene un ViewStack con dos elementos, en uno pondremos un panel de autenticación:</p>
<p><a href="http://www.madeinflex.com/wp-content/uploads/2010/11/login.jpg"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/login.jpg" alt="login" title="login" width="175" height="85" class="aligncenter size-full wp-image-1944" /></a></p>
<p>Al introducir un nombre de usuario y contraseña válidos pasaremos al segundo elemento del  View Stack, en el cual se realizará la gestión de la entidad:</p>
<p><a href="http://www.madeinflex.com/wp-content/uploads/2010/11/crud.jpg"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/crud.jpg" alt="crud" title="crud" width="274" height="211" class="aligncenter size-full wp-image-1945" /></a></p>
<p>Para estructurar mejor el proyecto nos auxiliaremos del framework Robotlegs. Lo primero que haremos será incluir en el proyecto las librerías del framework Pimento y Cinnamon. Copiamos en la carpeta “libs” del proyecto los archivos “cinnamon-1.1.0.swc” y “pimento-1.1.0.swc” que se encuentran en la carpeta “client\release” de la distribución, incluimos también “spicelib-core-2.0.1.swc” y “spicelib-reflect-2.0.1.swc” de la carpeta “client\lib” y la librería del framework Robotlegs.</p>
<p>Luego procedemos a crear el equivalente AS3 de la entidad creada en java:</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=3&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=3&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Como podemos ver, no se incluye el metadata “RemoteClass”, que normalmente utilizamos para indicar la clase equivalente a ésta en el servidor, Pimento y Cinnamon se encargan de registrar la clase y realizar todo el proceso de serialización/deserialización entre AS3 y Java de las instancias cuando viajan de cliente a servidor y viceversa.</p>
<p>La configuración del framework en el cliente comienza con la creación de una instancia de la clase “PimentoConfig”, a través de la cual podemos obtener el “EntityManager” que usaremos para invocar las operaciones de persistencia. La clase PimentoConfig necesita conocer el URL de la aplicación JEE que a través de Cinnamon recibirá las solicitudes del cliente para invocar las operaciones de persistencia, específicamente el URL al servlet “service”. En nuestro caso cargaremos esta información de un archivo xml externo. El comando que hace todo esto queda así:</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=4&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=4&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>El contenido del archivo “config.xml” que se encuentra en la carpeta “src/config” del proyecto Flex es el siguiente:</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=5&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=5&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Cuando el usuario introduzca un nombre de usuario y contraseña válidos se ejecutará el comando que realiza la autenticación, que es éste:</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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=6&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=6&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Como vemos en el método “execute”, el modo de uso de la clase EntityManager de Pimento es muy similar a su homóloga de JPA, pero con la característica distintiva que las operaciones de persistencia son asincrónicas, de ahí que debamos registrar manejadores para obtener los resultados y los posibles errores.</p>
<p>De forma similar el código para realizar las operaciones CRUD queda así:</p>
<p>Adicionar<br />
<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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=7&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=7&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Modificar<br />
<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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=8&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=8&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Eliminar<br />
<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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=9&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=9&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>Listar<br />
<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="500" height="200" 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=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=10&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		  <embed src="http://www.madeinflex.com/./wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="500" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=500&#038;h=200&#038;file=http://www.madeinflex.com/index.php&#038;ftf=true&#038;postID=1935&#038;no=10&#038;def=http://www.madeinflex.com./wp-content/plugins/FlashTextFormatter/definitions/as2.xml&#038;auto=true&#038;" />
		</object></p>
<p>El código fuente de los proyectos del servidor y el cliente se puede descargar de <a href="http://www.madeinflex.com/wp-content/uploads/2010/11/PimentoCinnamonDemo.zip">aquí</a>.</p>
<h4 id="toc-conclusiones">Conclusiones</h4>
<p>Hemos visto el modelo de programación más simple de Pimento Data Services, este modelo nos permite trasladar al cliente la lógica de la capa de servicios e invocar directamente desde éste las operaciones de persistencia de JPA en el servidor. Hemos dejado fuera las funcionalidades del “lazy loading” y los servicios personalizados, que serán tratados en artículos futuros.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2010/11/27/operaciones-crud-desde-flex-con-pimento-y-cinnamon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Novedades del nuevo Flash Builder &#8220;Burrito&#8221;</title>
		<link>http://www.madeinflex.com/2010/11/05/novedades-del-nuevo-flash-builder-burrito/</link>
		<comments>http://www.madeinflex.com/2010/11/05/novedades-del-nuevo-flash-builder-burrito/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 06:28:49 +0000</pubDate>
		<dc:creator>Sergi Dote Teixidor</dc:creator>
				<category><![CDATA[Artículos]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=1905</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Flash Builder ha vuelto a evolucionar con esta release llamada “Burrito”. “Burrito” no está completo, esta es su primera release, pero en ella podremos experiementar algunas de sus nuevas características y mejoras y el soporte sobre el nuevo Flex  SDK “Hero”, el cual también es una preview release.

Desarrollo de aplicaciones mobile y multi-screen
Flash Builder [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Flash Builder ha vuelto a evolucionar con esta release llamada “Burrito”. “Burrito” no está completo, esta es su primera release, pero en ella podremos experiementar algunas de sus nuevas características y mejoras y el soporte sobre el nuevo Flex  SDK “Hero”, el cual también es una preview release.<br />
<span id="more-1905"></span></p>
<h2 id="toc-desarrollo-de-aplicaciones-mobile-y-multi-screen"><strong>Desarrollo de aplicaciones mobile y multi-screen</strong></h2>
<p>Flash Builder “Burrito” nos ofrece un completo soporte para el desarrollo, testeo y despliegue de aplicaciones mobile AIR usando el nuevo SDK de Flex (Hero) o ActionScript.<br />
Podemos crear  proyectos  mobile hechos en Flex o ActionScript y empaquetarlos para diferentes plataformas móviles. De momento sólo para Android, pero en las siguientes versiones se soportarán Apple iOS y BlackBerry Tablet OS.</p>
<h2 id="toc-mejoras-en-la-productividad"><strong>Mejoras en la productividad</strong></h2>
<h4 id="toc-plantillas-de-codigo">Plantillas de código</h4>
<p>Las plantillas de código nos permiten insertar patrones de códig frecuentemente usados (Ctrl + Space en windows o Cmd + Space en mac). Tenemos plantillas de código para ActionScript y también para mxml. Podemos definir las nuestras y también importarlas o exportarlas:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-05-a-las-06.54.17.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-05-a-las-06.54.17-150x150.png"  width="150" height=""150 class="alignleft size-thumbnail wp-image-1908" /></a></p>
<p>Asistente de plantilla de código para ActionScript:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.10.57.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.10.57-300x115.png" width="300" height="115" class="alignleft size-medium wp-image-1912" /></a></p>
<p>Asistente de plantilla de código para MXML:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.12.10.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.12.10-272x300.png" width="272" height="300" class="alignleft size-medium wp-image-1914" /></a><br />
Estas plantillas de código se pueden editar en Preferences > Flash Builder > Editors > Code Templates > ActionScript/CSS/MXML.</p>
<h4 id="toc-completado-de-tags-metadata">Completado de tags Metadata </h4>
<p>Los diferentes tag Metadata se muestran cuando escribimos en carácter ‘[‘  a una clase, método o declaración de variable. Nos aparece la lista de tags válidos:<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.21.04.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.21.04-300x140.png" width="300" height="140" class="alignleft size-medium wp-image-1916" /></a></p>
<p>Si el tag metadata tiene propiedades, como puede ser el nombre del evento en el tag metadata Event, podemos usar el asistente de contenido para rellenar esta información:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.22.20.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.22.20-300x164.png" width="300" height="164" class="alignleft size-medium wp-image-1917" /></a></p>
<p>Un aspecto interesante es que “Burrito” soporta tags metadata de librerías  SWC third party, pero se require poner el fichero metadata.xml en ellas.</p>
<h4 id="toc-sobreescritura-e-implementacion-de-metodos">Sobreescritura e implementación de métodos</h4>
<p>A menudo necesitamos sobreescribir o implementar métodos de una super clase o de una interface. “Burrito” nos ofrece un nuevo menu contextual para facilitarnos esta tarea:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.26.56.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.26.56-300x208.png" width="300" height="208" class="alignleft size-medium wp-image-1918" /></a></p>
<p>Este asistente nos permitirá determinar que sobreescribir o implimentar:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.27.03.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.27.03-300x229.png" width="300" height="229" class="alignleft size-medium wp-image-1920" /></a></p>
<h4 id="toc-ayuda-rapida">Ayuda rápida</h4>
<p>La ayuda rápida nos facilita aún más la codificación. Aquí vemos un ejemplo de esta ayuda:<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.28.05.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.28.05-300x126.png" width="300" height="126" class="alignleft size-medium wp-image-1921" /></a></p>
<p>Según el ámbito en el que la invoquemos tendremos unas opciones u otras. Éstas son las posibles:</p>
<ul>
<li>Renombrar en el fichero actual,  permite renombrar variables, métodos, clases o parámetros en el fichero actual.</li>
<li>Renombrar en el workspace.</li>
<li>Convertir una variable variable local en un campo de la clase en la que nos encontramos.</li>
<li>Asignación a una variable, crea una nueva variable para asignarle la expresión que hayamos introducido.</li>
<li>Separación de la declaración de la variable, para separar la declaración de la asignación.</li>
<li>Generar getters y setters.</li>
<li>Organizar imports.</li>
</ul>
<h4 id="toc-generacion-de-codigo">Generación de código</h4>
<p>“Burrito” nos permite crear elementos en el código que aún no existen. Podemos generar:</p>
<ul>
<li><strong>Variables, al escribir el nombre de la variable podemos invocar su creación.</strong></li>
<li><strong>Métodos, parecido al anterior pero con métodos: </strong></li>
<p><a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.30.07.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.30.07-300x178.png" width="300" height="178" class="alignleft size-medium wp-image-1922" /></a></p>
<li><strong>Clases e interfaces:</strong></li>
<p><a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.31.00.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.31.00-300x170.png" width="300" height="170" class="alignleft size-medium wp-image-1923" /></a></p>
<li><strong>Event handlers: </strong></li>
<p><a href="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.32.42.png"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/Captura-de-pantalla-2010-11-03-a-las-07.32.42-300x156.png" width="300" height="156" class="alignleft size-medium wp-image-1924" /></a>
</ul>
<h2 id="toc-un-flujo-de-trabajo-mejorado-entre-disenador-y-desarrollador"><strong>Un flujo de trabajo mejorado entre diseñador y desarrollador</strong></h2>
<p>Mediante Flash Builder 4 y Flash Catalyst CS5 los diseñadores y desarrolladores pueden colaborar en el desarrollo de proyectos Flex.<br />
Flash Catalyst también ha sido mejorado en la nueva versión llamada “Panini”. Estas mejoras están muy centradas a cerrar el ciclo de interacción con Flash Builder 4. Ahora tenemos bidireccionalidad de movimiento entre estas dos herramientas, como podemos ver en la siguiente imagen, cosa que no pasaba en las versiones anteriores.<br />
<a href="http://www.madeinflex.com/wp-content/uploads/2010/11/1286227978111.jpg"><img src="http://www.madeinflex.com/wp-content/uploads/2010/11/1286227978111-300x131.jpg" width="300" height="131" class="alignleft size-medium wp-image-1926" /></a><br />
Ahora Flash Catalyst permite generación de código y soporta la creación de interfaces redimensionables.<br />
Para permitir las nuevas funcionalidades en el nuevo Flash Catalyst “Panini”, se han tenido que añadir nuevas características a Flash Builder “Burrito”:<br />
El desarrollador debe tener en cuenta al trabajar con un diseñador la compatibilidad de ciertas características en Flash Catalyst; para eso hay configuraciones a nivel de protecto para hacerlo compatible con Flash Catalyst. Flash Builder nos permite marcar un proyecto como compatible con Flash Catalyst, esto hará que aparezcan advertencias si ciertos componentes, atributos o configuraciones del proyecto pueden ser problemáticos al importar el proyecto en Flash Catalyst.<br />
Flash Catalyst permite convertir artwork a skins de componentes con custom skinnable components definidos por el developer. Flash Builder proporciona un asistente para poder generar las clases ActionScript, especificar los skin states, skin parts y la lógica de negocio del componente.</p>
<h2 id="toc-actualizacion-del-soporte-a-la-plataforma-y-rendimiento-mejorado"><strong>Actualización del soporte a la plataforma y rendimiento mejorado</strong></h2>
<p>Esta versión de Flash Builder está corriendo sobre la última versión de Eclipse (3.6 “Helios”). En Mac OS X Flash Builder usa la versión “Cocoa” de Eclipse no da soporte a la anterior versión “Carbon”.<br />
Flash Builder ahora incluye las últimas versiones de las tecnologías de Adobe: incluye el SDK Flex “Hero”, Adobe AIR 2.5 y Flash Player 10.1. </p>
<p>Otro ámbito en el que se ha mejorado es en el instalador de Flash Builder. Ya no tenemos descargas separadas para la versión plug-in o la standalone. Después de la instalación de la versión standalone, podemos usar una herramienta que se encuentra en el directorio de utilities, dentro del directorio de instalación de “Burrito” para configurar si Flash Builder debe trabajar con una o más versiones de Eclipse.</p>
<p>También se ha mejorado el rendimiento y el uso de memoria, reduciendo hasta un 65% ciertas operaciones pesadas para conseguir un entorno más productivo. Se esperan realizar más reformas en estos aspectos que se verán aplicados en la final release.</p>
<h4 id="toc-mas-informacion-en">Más información en: </h4>
<p><a href="http://tv.adobe.com/channel/max/max-2010/">AdobeTV</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2010/11/05/novedades-del-nuevo-flash-builder-burrito/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>El nuevo Flash Builder: Burrito</title>
		<link>http://www.madeinflex.com/2010/09/15/el-nuevo-flash-builder-burrito/</link>
		<comments>http://www.madeinflex.com/2010/09/15/el-nuevo-flash-builder-burrito/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 05:27:34 +0000</pubDate>
		<dc:creator>Sergi Dote Teixidor</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Noticias]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/?p=1791</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Adobe ha anunciado que están trabajando en una nueva versión de Flash Builder llamada &#8220;Burrito&#8221;. En esta versión quieren da más potencia al IDE y que los developers ganen más productividad.
Aquí os dejo el enlace.]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Adobe ha anunciado que están trabajando en una nueva versión de Flash Builder llamada &#8220;Burrito&#8221;. En esta versión quieren da más potencia al IDE y que los developers ganen más productividad.</p>
<p>Aquí os dejo el <a href="http://blogs.adobe.com/flex/2010/09/flash-builder-codename-burrito.html?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed%3A+flexteam+%28The+Official+Flex+Team+Blog%29&#038;utm_content=Google+Reader">enlace</a>. </p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2010/09/15/el-nuevo-flash-builder-burrito/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>[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>En tiempos de crisis, Adobe se acuerda de nosotros</title>
		<link>http://www.madeinflex.com/2009/04/06/en-tiempos-de-crisis-adobe-se-acuerda-de-nosotros/</link>
		<comments>http://www.madeinflex.com/2009/04/06/en-tiempos-de-crisis-adobe-se-acuerda-de-nosotros/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 22:08:22 +0000</pubDate>
		<dc:creator>Jose Luis Ugía González</dc:creator>
				<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Noticias]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2009/04/06/en-tiempos-de-crisis-adobe-se-acuerda-de-nosotros/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Como ya sabíamos, Adobe ofrecía una copia de Flex Builder gratuita a cualquier estudiante que pudiera demostrar esto, presentando normalmente algún documento escaneado que nos identifique como tal.
Pues ahora, y ya que el temporal económico aprieta, Adobe ha tenido la genial idea de ofrecer esto mismo, una copia de Adobe Flex Builder gratuita, a todo [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Como ya sabíamos, Adobe ofrecía <a href="http://freeriatools.adobe.com/">una copia de Flex Builder gratuita</a> a cualquier estudiante que pudiera demostrar esto, presentando normalmente algún documento escaneado que nos identifique como tal.</p>
<p>Pues ahora, y ya que el temporal económico aprieta, Adobe ha tenido la genial idea de ofrecer esto mismo, <a href="https://freeriatools.adobe.com/learnflex/">una copia de Adobe Flex Builder gratuita</a>, a todo el que se haya quedado sin trabajo, eso si, tanto en el primer como en el segundo caso no podremos usar esta con propósitos comerciales, no podía ser todo.</p>
<p>Al menos no todo son malas noticias. No quedará desarrollador desempleado sin Flex Builder.</p>
<p>Os dejo el link del <a href="http://theflashblog.com/?p=887">post original</a> de <a href="http://theflashblog.com/">The Flash Blog</a> de Lee Brimelow.</p>
<p>A por ella, un saludo a todos <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/2009/04/06/en-tiempos-de-crisis-adobe-se-acuerda-de-nosotros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clear Toolkit framework</title>
		<link>http://www.madeinflex.com/2009/03/08/clear-toolkit-framework/</link>
		<comments>http://www.madeinflex.com/2009/03/08/clear-toolkit-framework/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 10:05:27 +0000</pubDate>
		<dc:creator>Joan Garnet</dc:creator>
				<category><![CDATA[Componentes]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Recursos]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2009/03/08/clear-toolkit-framework/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->La gente de Farata Systems ha liberado su framework "Clear Toolkit framework" para desarrollo de enterprise RIAs con Flex y Java. El framework está disponible en sourceforge bajo licencia MIT.
Clear Toolkit framework dispone de varios componentes:

Clear Data Builder: plugin de Eclipse para generación de aplicaciones CRUD para BlazeDS o LCDS a partir de sentencias SQL [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>La gente de <a href="http://flexblog.faratasystems.com/">Farata Systems</a> ha liberado su framework "Clear Toolkit framework" para desarrollo de enterprise RIAs con Flex y Java. El framework está disponible en <a href="http://sourceforge.net/projects/cleartoolkit/">sourceforge</a> bajo licencia MIT.<br />
Clear Toolkit framework dispone de varios componentes:</p>
<ul>
<li><strong>Clear Data Builder</strong>: plugin de Eclipse para generación de aplicaciones CRUD para BlazeDS o LCDS a partir de sentencias SQL o Java DTOs</li>
<li><strong>DTO2Fx</strong>: generador de clases ActionScript a partir de sus homólogas en Java</li>
<li><strong>Log4Fx</strong>: plugin de Eclipse para la API de logging de Flex. Automatiza y hace el proceso de logging más amigable</li>
<li><strong>Fx2Ant</strong>: generador de ANT build scripts optimizados para proyectos de Flex Builder</li>
<li><strong>clear.swc</strong>: Librería avanzada de componentes Flex situada en el paquete <code>com.farata.components</code></li>
</ul>
<p>Además de lo mencionado puedes ver <a href="http://sourceforge.net/forum/forum.php?forum_id=921193">el roadmap para la version 4 aquí</a>.<br />
Algunos enlaces relacionados:</p>
<ul>
<li><a href="http://sourceforge.net/projects/cleartoolkit/">Clear Toolkit framework</a></li>
<li><a href="http://flexblog.faratasystems.com/?p=399">Introducing Enhanced Flex Components from Clear Toolkit Framework</a></li>
<li><a href="http://flexblog.faratasystems.com/?p=398">Clear Data Builder: data synchronization in a multi-user environment</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2009/03/08/clear-toolkit-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nueva Release de Adobe AIR 1.5.1</title>
		<link>http://www.madeinflex.com/2009/02/27/nueva-release-de-adobe-air-151/</link>
		<comments>http://www.madeinflex.com/2009/02/27/nueva-release-de-adobe-air-151/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 10:00:59 +0000</pubDate>
		<dc:creator>Jose Luis Ugía González</dc:creator>
				<category><![CDATA[AIR (Apollo)]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Noticias]]></category>

		<guid isPermaLink="false">http://www.madeinflex.com/2009/02/27/nueva-release-de-adobe-air-151/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Queridos compañeros:
La nueva release de Adobe AIR está en las calles.
Si bien es cierto que esta actualización no representa una gran mejora en lo que respecta a nuevas funcionalidades, si que soluciona una buena lista de bugs , con los que estoy seguro mas de uno os habéis encontrado alguna vez.

Destacaría entre ellos:
-Mejora de uso [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Queridos compañeros:</p>
<p>La nueva release de <a href="http://get.adobe.com/air/" title="Descarga de Adobe AIR" target="_blank">Adobe AIR</a> está en las calles.<br />
Si bien es cierto que esta actualización no representa una gran mejora en lo que respecta a nuevas funcionalidades, si que soluciona una buena <a href="http://www.adobe.com/support/documentation/en/air/1_5_1/releasenotes_developers.html#fixed_bugs" title="Lista de bugs" target="_blank">lista de bugs</a> , con los que estoy seguro mas de uno os habéis encontrado alguna vez.</p>
<p><span id="more-792"></span></p>
<p>Destacaría entre ellos:</p>
<p>-Mejora de uso de memoria en reproducción de video</p>
<p>-Evitar que nuestra aplicación falle y se nos cierre por tener activado el AdBlock de Safari en ciertas peticiones.</p>
<p>-Errores desinstalando AIR Apps (este último no me importaba <img src='http://www.madeinflex.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   ) , entre otros..</p>
<p>Esta nueva versión es la 1.5.1, y para los que tenéis aplicaciones desarrolladas en AIR, como sabéis, debéis actualizar vuestro descriptor de aplicación a la versión <strong>1.5.1</strong> para poder usar la nueva API introducida, <a href="http://blogs.adobe.com/simplicity/2009/02/invokeevent_reason_in_air_1_5_1.html" title="InvokeEvent" target="_blank">InvokeEvent.reason</a>, muy útil en mi opinión ya que nos permite conocer, no solo cuando ha sido lanzada nuestra aplicación, sino desde donde (login o standard).<br />
Para disfrutar de las demás mejoras no es necesario actualizar la versión en vuestro descriptor.<br />
Así pues, a seguir desarrollando mas y mejor.</p>
<p>Un saludo a todos.</p>]]></content:encoded>
			<wfw:commentRss>http://www.madeinflex.com/2009/02/27/nueva-release-de-adobe-air-151/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

