<?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>Robot04 &#187; AIR</title>
	<atom:link href="http://www.robot04.com/blog/index.php/category/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robot04.com/blog</link>
	<description>Video meliora proboque; deteriora sequor</description>
	<lastBuildDate>Thu, 30 Dec 2010 11:08:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reforest</title>
		<link>http://www.robot04.com/blog/index.php/2010/06/13/reforest/</link>
		<comments>http://www.robot04.com/blog/index.php/2010/06/13/reforest/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 01:57:27 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=350</guid>
		<description><![CDATA[
Reforest es una aplicación desarrollada en Adobe AIR que crea estructuras de proyecto a través de plantillas.
Estas plantillas pueden ser configuradas al gusto de cada uno para crear el árbol de carpetas y archivos que formarán nuestro directorio de proyecto.
El ejemplo que viene con Reforest, cuando lo descargáis, es un MVC simple con Flash y [...]]]></description>
			<content:encoded><![CDATA[<p><img class="fullsizetop" src="http://www.robot04.com/blog/index.php?feedimage=wp-content/uploads/2010/06/reforest.jpg" alt="Reforest" title="reforest.jpg" border="0" width="760" height="198" /></p>
<p><a href="http://www.reforestair.com">Reforest</a> es una aplicación desarrollada en Adobe AIR que crea estructuras de proyecto a través de plantillas.</p>
<p>Estas plantillas pueden ser configuradas al gusto de cada uno para crear el árbol de carpetas y archivos que formarán nuestro directorio de proyecto.<br />
El ejemplo que viene con Reforest, cuando lo descargáis, es un MVC simple con Flash y AS3, pero se puede utilizar para cualquier tipo de proyecto, diseño, .php, html, etc</p>
<p>La plantilla, a partir de ahora semilla (.seed), está compuesta por los siguientes nodos:</p>
<h3>info</h3>
<p>Info es la parte de la semilla que nos va a proveer de la información de ésta, como autor, fecha, nombre, descripción, etc.</p>
<p>Esta es la estructura:</p>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-5">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;seed<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;info<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;author<span style="font-weight: bold; color: black;">&gt;</span></span></span>Robot04<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/author<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;date<span style="font-weight: bold; color: black;">&gt;</span></span></span>09/09/09<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/date<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Example Template<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Estructura de proyecto base con vista y controlador<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;notes<span style="font-weight: bold; color: black;">&gt;</span></span></span>Acuérdate de borrar el árbol de main.fla <img src='http://www.robot04.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/notes<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/info<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/seed<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Después encontramos la estructura.</p>
<h3>structure</h3>
<p>Structure es la etiqueta que va a contenter nuestro proyecto, y en ella podremos crear y copiar los archivos y directorios que solamos utilizar frecuentemente en nuestros proyectos.</p>
<p>Dentro de structure podremos utilizar dos tipos de etiquetas diferentes:</p>
<ul>
<li>folder</li>
<li>file</li>
</ul>
<h3>folder</h3>
<p><strong>Folder</strong> es la encargada de crear los directorios, tiene un sólo parámetro obligatorio <strong>name</strong>.<br />
Si el valor del parámetro name es <strong>projectName</strong>, el valor se sustituirá en tiempo de ejecución por el nombre que elijamos para el proyecto.</p>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-6">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;seed<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;info<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;author<span style="font-weight: bold; color: black;">&gt;</span></span></span>Robot04<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/author<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;date<span style="font-weight: bold; color: black;">&gt;</span></span></span>09/09/09<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/date<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Example Template<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Estructura de proyecto base con vista y controlador<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;notes<span style="font-weight: bold; color: black;">&gt;</span></span></span>Acuérdate de borrar el árbol de main.fla <img src='http://www.robot04.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/notes<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/info<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;structure<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;folder</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"projectName"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/folder<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/structure<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/seed<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<h3>file</h3>
<p>El nodo <strong>file</strong> se encarga de copiar archivos y carpetas a nuestro directorio de proyecto.</p>
<p>Tiene dos parámetros obligatorios:</p>
<ul>
<li>name</li>
<li>route</li>
</ul>
<p><strong>Name</strong> indica el nombre con el cual se guardará el archivo en nuestro directorio de proyecto y <strong>route</strong> es el path al archivo que se va a copiar.</p>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-7">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;seed<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;info<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;author<span style="font-weight: bold; color: black;">&gt;</span></span></span>Robot04<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/author<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;date<span style="font-weight: bold; color: black;">&gt;</span></span></span>09/09/09<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/date<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Example Template<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Estructura de proyecto base con vista y controlador<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;notes<span style="font-weight: bold; color: black;">&gt;</span></span></span>Acuérdate de borrar el árbol de main.fla <img src='http://www.robot04.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/notes<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/info<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;structure<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;folder</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"projectName"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;folder</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"flash"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;file</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"main.fla"</span> <span style="color: #000066;">route</span>=<span style="color: #ff0000;">"files/flash/main.fla"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/folder<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/folder<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/seed<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p><em>Además de esto y esta es la joyita de Reforest</em>, el nodo <strong>file</strong> tiene un atributo opcional <strong>parse</strong>.</p>
<p>Si le decimos a Reforest que parsee el documento con el atributo <strong>parse="true"</strong>. Reforest buscará en esos archivos variables de Reforest y nos permitirá durante la creación del proyecto cambiar sus valores por otros al vuelo.</p>
<p>Las variables de Reforest tienen el siguiente aspecto:<br />
<strong>%RFST:Variable=Valor%</strong></p>
<p>Por ejemplo un uso básico en un archivo html podría ser:<br />
<strong>&lt;title&gt;%RFST:title=titulo%&lt;/title&gt;</strong></p>
<p>o en un .as podríamos ajustar las características de nuestro fla de la siguiente manera:</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-8">
<div class="actionscript"><span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"%RFST:SWFWidth=1004%"</span>, <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"%RFST:SWFHeight=680%"</span>, <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">"%RFST:SWFBGColor=#FFFFFF%"</span>, frameRate=<span style="color: #ff0000;">"%RFST:SWFFramerate=30%"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></div>
</div>
</div>
<p></p>
<p>Espero que lo disfrutéis y si tenéis sugerencias o dudas, ya sabéis <img src='http://www.robot04.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>PD: Junto con el instalador de Reforest encontraréis más información y un ejemplo de uso.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2010/06/13/reforest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR Autoupdater  en 10 pasos</title>
		<link>http://www.robot04.com/blog/index.php/2009/07/14/air-autoupdater-en-10-pasos/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/07/14/air-autoupdater-en-10-pasos/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 17:12:08 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=333</guid>
		<description><![CDATA[Ale, aquí os dejo cómo configurar un autoupdater  para AIR en diez pasos.
1. Bajar el SDK de AIR.
2. Copiar el archivo applicationupdater_ui.swc a nuestra carpeta de proyecto.
3. Linkarlo en configuración de publicación.

4. Crear un updateConfig.xml con los siguientes parámetros:
XML:

&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0"&#62;
&#160; &#160; &#60;url&#62;http://www.robot04.com/reforest/update.xml&#60;/url&#62;
&#160; &#160;&#60;delay&#62;1&#60;/delay&#62;
&#160; &#160; &#60;defaultUI&#62;
&#160; &#160;&#160; &#160; &#160; &#160; &#60;dialog name="checkForUpdate" visible="false" [...]]]></description>
			<content:encoded><![CDATA[<p>Ale, aquí os dejo cómo configurar un autoupdater  para AIR en diez pasos.</p>
<p>1. Bajar el <a href="http://www.adobe.com/products/air/tools/sdk/">SDK de AIR</a>.<br />
2. Copiar el archivo <strong>applicationupdater_ui.swc</strong> a nuestra carpeta de proyecto.<br />
3. <strong>Linkarlo</strong> en configuración de publicación.</p>
<p><img class="fullsize" src="http://www.robot04.com/blog/index.php?feedimage=wp-content/uploads/2009/07/advanced_settings_as3.jpg" alt="advanced_settings_as3.jpg" border="0" width="760" height="580" /></p>
<p>4. Crear un <strong>updateConfig.xml</strong> con los siguientes parámetros:</p>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-12">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;configuration</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://ns.adobe.com/air/framework/update/configuration/1.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://www.robot04.com/reforest/update.xml<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;delay<span style="font-weight: bold; color: black;">&gt;</span></span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/delay<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;defaultUI<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dialog</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"checkForUpdate"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"false"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dialog</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"downloadUpdate"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dialog</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"downloadProgress"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dialog</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"installUpdate"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dialog</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"fileUpdate"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"false"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dialog</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"unexpectedError"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/defaultUI<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/configuration<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p>
5. En el Main o donde iniciéis la app (esto es solo una muestra, a partir de aquí se pueden jugar con todos los parámetros del ApplicationUpdater y configurarlo a vuestro gusto):</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-13">
<div class="actionscript">package<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> air.<span style="color: #006600;">update</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">UpdateEvent</span>;&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> air.<span style="color: #006600;">update</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">StatusUpdateErrorEvent</span>;&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">ErrorEvent</span>;&nbsp;&nbsp;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> air.<span style="color: #006600;">update</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">StatusUpdateEvent</span>;&nbsp;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> air.<span style="color: #006600;">update</span>.<span style="color: #006600;">ApplicationUpdaterUI</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initUpdater<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> initUpdater<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater = <span style="color: #000000; font-weight: bold;">new</span> ApplicationUpdaterUI<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>StatusUpdateErrorEvent.<span style="color: #006600;">UPDATE_ERROR</span>, updateError<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>UpdateEvent.<span style="color: #006600;">INITIALIZED</span>, updateInitialized<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>StatusUpdateEvent.<span style="color: #006600;">UPDATE_STATUS</span>, updateStatus<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater.<span style="color: #006600;">configurationFile</span> = <span style="color: #000000; font-weight: bold;">new</span> File<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"app:/updateConfig.xml"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateInitialized<span style="color: #66cc66;">&#40;</span>event:UpdateEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; checkForUpdates<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> checkForUpdates<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appUpdater.<span style="color: #006600;">checkNow</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateError<span style="color: #66cc66;">&#40;</span>event:ErrorEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Error"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateStatus<span style="color: #66cc66;">&#40;</span>event:StatusUpdateEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"update status: "</span> + event.<span style="color: #0066CC;">version</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"update available: "</span> + event.<span style="color: #006600;">available</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"update details: "</span> + event.<span style="color: #006600;">details</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p>
6. <strong>Añadir el updateConfig.xml en los settings de AIR</strong>: File --> AIR Settings --> Included Files + updateConfig.xml.<br />
7. <strong>Compilar</strong> versión dejando, por ejemplo, en los AIR Settings en el campo de <strong>versión 0.90</strong>, la <strong>instalamos</strong> y <strong>compilamos</strong> otra versión cambiando el valor de la <strong>versión a la 0.91</strong>.<br />
8. Crear un update.xml con:</p>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-14">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;update</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://ns.adobe.com/air/framework/update/description/1.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>0.91<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://www.robot04.com/reforest/reforest.air<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[<br />
Versión 0.91<br />
&nbsp;* Añadida actualización automática<br />
&nbsp;]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/update<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p>
9. <strong>Subir la versión nueva y el update.xml</strong> al servidor.<br />
10. Añadir un nuevo <strong>tipo MIME ".air"</strong> al server</p>
<p>Abrimos la aplicación instalada y veremos que nos aparece la ventana de Update para descargar la nueva versión.<br />
Nota: joder que mal se ven los estilos de syntax hiliter para los xml. Ya lo cambiaré.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/07/14/air-autoupdater-en-10-pasos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

