<?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; ActionScript 3.0</title>
	<atom:link href="http://www.robot04.com/blog/index.php/category/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robot04.com/blog</link>
	<description>Video meliora proboque; deteriora sequor</description>
	<lastBuildDate>Sat, 03 Jul 2010 11:14:45 +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>Eclipse FDT Loading Workbench Cuelgue</title>
		<link>http://www.robot04.com/blog/index.php/2010/07/03/eclipse-fdt-loading-workbench-cuelgue/</link>
		<comments>http://www.robot04.com/blog/index.php/2010/07/03/eclipse-fdt-loading-workbench-cuelgue/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 11:12:28 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Aplicaciones]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=364</guid>
		<description><![CDATA[Si alguna vez te ocurre que al abrir Eclipse se te queda en: Loading Workbench&#8230; esta es la solución:
Vas a .metadata/.plugins/org.eclipse.core.resources y borras el archivo .snap
]]></description>
			<content:encoded><![CDATA[<p>Si alguna vez te ocurre que al abrir Eclipse se te queda en: Loading Workbench&#8230; esta es la solución:</p>
<p>Vas a <strong>.metadata/.plugins/org.eclipse.core.resources</strong> y borras el archivo <strong>.snap</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2010/07/03/eclipse-fdt-loading-workbench-cuelgue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enamorado de Signals</title>
		<link>http://www.robot04.com/blog/index.php/2010/06/13/enamorado-de-signals/</link>
		<comments>http://www.robot04.com/blog/index.php/2010/06/13/enamorado-de-signals/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 02:15:53 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=356</guid>
		<description><![CDATA[Y para muestra un botón  
Actionscript:

package view.ui.common 
&#123;
&#160; &#160; import com.greensock.TweenMax;
&#160; &#160; import flash.events.MouseEvent;
&#160; &#160; import org.osflash.signals.natives.NativeSignal;
&#160; &#160; import flash.display.Sprite;
&#160; &#160; /**
&#160; &#160;&#160; * @author robot04
&#160; &#160;&#160; */
&#160; &#160; public class BasicButton extends Sprite 
&#160; &#160; &#123;
&#160; &#160; &#160; &#160; private var overed:NativeSignal;
&#160; &#160; &#160; &#160; private var outed:NativeSignal;
&#160; &#160; &#160; &#160; public var [...]]]></description>
			<content:encoded><![CDATA[<p>Y para muestra un botón <img src='http://www.robot04.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript">package view.<span style="color: #006600;">ui</span>.<span style="color: #006600;">common</span> <br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">greensock</span>.<span style="color: #006600;">TweenMax</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osflash</span>.<span style="color: #006600;">signals</span>.<span style="color: #006600;">natives</span>.<span style="color: #006600;">NativeSignal</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**<br />
&nbsp; &nbsp;&nbsp; * @author robot04<br />
&nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BasicButton <span style="color: #0066CC;">extends</span> Sprite <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> overed:NativeSignal;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> outed:NativeSignal;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> clicked:NativeSignal;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> BasicButton<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; buttonMode = <span style="color: #000000; font-weight: bold;">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mouseChildren = <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; overed = <span style="color: #000000; font-weight: bold;">new</span> NativeSignal<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, MouseEvent.<span style="color: #006600;">MOUSE_OVER</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outed = <span style="color: #000000; font-weight: bold;">new</span> NativeSignal<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, MouseEvent.<span style="color: #006600;">MOUSE_OUT</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clicked = <span style="color: #000000; font-weight: bold;">new</span> NativeSignal<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, MouseEvent.<span style="color: #006600;">CLICK</span>, MouseEvent<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> removeListeners<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; overed.<span style="color: #006600;">remove</span><span style="color: #66cc66;">&#40;</span>onOver<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outed.<span style="color: #006600;">remove</span><span style="color: #66cc66;">&#40;</span>onOut<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addListeners<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; overed.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>onOver<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outed.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>onOut<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; protected <span style="color: #000000; font-weight: bold;">function</span> onOut<span style="color: #66cc66;">&#40;</span>event:MouseEvent<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; TweenMax.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, .<span style="color: #cc66cc;">4</span>, <span style="color: #66cc66;">&#123;</span>alpha:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; protected <span style="color: #000000; font-weight: bold;">function</span> onOver<span style="color: #66cc66;">&#40;</span>event:MouseEvent<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; TweenMax.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, .<span style="color: #cc66cc;">4</span>, <span style="color: #66cc66;">&#123;</span>alpha:.<span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#125;</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></p>
<p><a href="http://flashblog.robertpenner.com/2009/09/my-new-as3-event-system-signals.html">Robert Penner - Signals</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2010/06/13/enamorado-de-signals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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-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 />
<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-8">
<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-9">
<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 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-10">
<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-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;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-15">
<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-16">
<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>
		<item>
		<title>Config Constants &#8211; ActionScript 3.0</title>
		<link>http://www.robot04.com/blog/index.php/2009/05/04/config-constants-actionscript-30/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/05/04/config-constants-actionscript-30/#comments</comments>
		<pubDate>Mon, 04 May 2009 14:55:20 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=310</guid>
		<description><![CDATA[Config Constants en Flash CS4. Con la creación de las constantes de configuración podemos acceder a partes de nuestro código dependiendo del valor de las mismas. Para ver un pequeño ejemplo, imaginad que tenéis un fla que va a ir en dos idomas, con las constantes podemos hacer que un mismo fla (o fla diferentes) [...]]]></description>
			<content:encoded><![CDATA[<p>Config Constants en Flash CS4. Con la creación de las constantes de configuración podemos acceder a partes de nuestro código dependiendo del valor de las mismas. Para ver un pequeño ejemplo, imaginad que tenéis un fla que va a ir en dos idomas, con las constantes podemos hacer que un mismo fla (o fla diferentes) accedan a un idioma en la programación o a otro.</p>
<p>Creamos un par de Constantes, una para el español CONFIG::ES y otra para el portugués CONFIG::PT y le damos a la primera un valor de true y a la segunda un valor de false en la configuración de publicación.</p>
<p><img src="http://www.robot04.com/blog/index.php?feedimage=wp-content/uploads/2009/05/configconstants.jpg" alt="ConfigConstants.jpg" border="0" width="614" height="740" /></p>
<p>Después en nuestro código podremos tener lo siguiente:</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-18">
<div class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> createButtons<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; CONFIG::ES <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; botones = <span style="color: #66cc66;">&#91;</span>&nbsp;<span style="color: #ff0000;">"El sistema de franquicias"</span>, <span style="color: #ff0000;">"Pasos a seguir"</span>, <span style="color: #ff0000;">"Tipos de tienda"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Inversión inicial"</span>, <span style="color: #ff0000;">"Criterios de emplazamiento"</span> <span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; CONFIG::PT <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; botones = <span style="color: #66cc66;">&#91;</span>&nbsp;<span style="color: #ff0000;">"O sistema de franchising"</span>, <span style="color: #ff0000;">"Passos a seguir"</span>, <span style="color: #ff0000;">"Tipos de loja"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Investimento Inicial"</span>, <span style="color: #ff0000;">"Critérios de localização"</span> <span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Al compilar la película flash cogerá lo que aparezca dentro del CONFIG::ES e ignorará lo que esté dentro del CONFIG:PT.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/05/04/config-constants-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fases de propagación de eventos &#8211; ActionScript 3.0</title>
		<link>http://www.robot04.com/blog/index.php/2009/04/25/ciclo-de-vida-de-los-eventos-actionscript-30/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/04/25/ciclo-de-vida-de-los-eventos-actionscript-30/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:28:14 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Apuntes que siempre se me olvidan]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=291</guid>
		<description><![CDATA[Stage-->MainTimeLine-->MovieClip-->TextField-->MovieClip-->MainTimeline-->Stage 
Cuando el evento se transmite hacia el objeto se le conoce como la Fase de Captura.
Cuando llega al TextField es la Target Fase.
Cuando vuelve a subir hacia el Stage Fase de Burbujeo (Bubbing) 
La fase de captura no se utiliza a no ser que lo especifiques explicitamente. 
Actionscript:

clip_mc.addEventListener&#40;MouseEvent.CLICK, botonClick, true&#41;;



Se suele usar para deshabilitar [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Stage-->MainTimeLine-->MovieClip-->TextField-->MovieClip-->MainTimeline-->Stage</strong> </p>
<p>Cuando el evento se transmite hacia el objeto se le conoce como la <strong>Fase de Captura</strong>.<br />
Cuando llega al TextField es la <strong>Target Fase.</strong><br />
Cuando vuelve a subir hacia el Stage <strong>Fase de Burbujeo (Bubbing)</strong> </p>
<p>La fase de captura no se utiliza a no ser que lo especifiques explicitamente. </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-20">
<div class="actionscript">clip_mc.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, botonClick, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p>
Se suele usar para deshabilitar eventos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/04/25/ciclo-de-vida-de-los-eventos-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eventos &#8211; ActionScript 3.0</title>
		<link>http://www.robot04.com/blog/index.php/2009/04/25/eventos-actionscript-30/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/04/25/eventos-actionscript-30/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:26:48 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Apuntes que siempre se me olvidan]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=289</guid>
		<description><![CDATA[Para enviar eventos usamos la clase EventDispatcher.
Se puede usar por herencia o por composición. 
Después tenemos que crear el evento 
Actionscript:

var event:Event = new Event&#40;"change"&#41;;



o lo que sería mejor 
Actionscript:

var event:Event = new Event&#40;Event.CHANGE&#41;;



y después tenemos que distribuir (lanzar) el evento: 
Actionscript:

dispatchEvent&#40;event&#41;;



Para usarlo por composición tenemos que implementar IEventDispatcher
En el constructor nos creamos un nuevo [...]]]></description>
			<content:encoded><![CDATA[<p>Para enviar eventos usamos la clase EventDispatcher.<br />
Se puede usar por herencia o por composición. </p>
<p>Después tenemos que crear el evento </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-29">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> event:Event = <span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"change"</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p>
o lo que sería mejor </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-30">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> event:Event = <span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">CHANGE</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p>
y después tenemos que distribuir (lanzar) el evento: </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-31">
<div class="actionscript">dispatchEvent<span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>Para usarlo por composición tenemos que implementar IEventDispatcher<br />
En el constructor nos creamos un nuevo EventDispatcher(); </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-32">
<div class="actionscript">dispatcher = <span style="color: #000000; font-weight: bold;">new</span> EventDispatcher<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//donde this es el target que distribuye el evento. </span></div>
</div>
</div>
<p>
Después en cada función definida por la Interfaz devolvemos el dispatcher: </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-33">
<div class="actionscript"><span style="color: #b1b100;">return</span> dispatcher.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>; <br />
<span style="color: #b1b100;">return</span> dispatcher.<span style="color: #006600;">hasEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span><span style="color: #66cc66;">&#41;</span>; <br />
<span style="color: #b1b100;">return</span> dispatcher.<span style="color: #006600;">willTrigger</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span><span style="color: #66cc66;">&#41;</span>; <br />
<span style="color: #b1b100;">return</span> dispatcher.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span>, listener, useCapture<span style="color: #66cc66;">&#41;</span>; etc</div>
</div>
</div>
<p></p>
<p>Cualquier DisplayObject hereda de DispatchEvent<br />
Si queremos crear un evento propio nuestro tenemos que crear una nueva clase que herede de Event y que llame explicitamente al constructor y crear una constante estática con el nombre y valor que queramos como evento. </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-34">
<div class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const LIMITE_EXCEDIDO:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"limite"</span>;</div>
</div>
</div>
<p>
Después en la clase en la que vamos a usar el evento generamos un nuevo evento EjemploEvent </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-35">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> evento:EjemploEvent = <span style="color: #000000; font-weight: bold;">new</span> EjemploEvent<span style="color: #66cc66;">&#40;</span>EjemploEvent.<span style="color: #006600;">LIMITE_EXCEDIDO</span><span style="color: #66cc66;">&#41;</span>; <br />
dispatchEvent<span style="color: #66cc66;">&#40;</span>evento<span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p>
En la clase en la que nos vayamos a apuntar al evento</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-36">
<div class="actionscript">foo.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>EjemploConEvento.<span style="color: #006600;">LIMITE_EXCEDIDO</span>, funcion<span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/04/25/eventos-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objetos y clases &#8211; ActionScript 3.0</title>
		<link>http://www.robot04.com/blog/index.php/2009/04/25/objetos-y-clases-actionscript-30/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/04/25/objetos-y-clases-actionscript-30/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:23:15 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Apuntes que siempre se me olvidan]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=287</guid>
		<description><![CDATA[Programación Procedural 
Instrucciones que generan procedimientos
En ActionScript todo lo relacionado a funciones que generan tareas. 
Pros
- Implantación rápida, resultados rápidos
Contras
- Poco mantenible a la larga, en aplicaciones con más de 500 líneas de código. 
Orientado a Objetos
Divide el código en entidades diferentes 
Pros
Escalables
Metodología de programación 
Contras
Implantación lenta
Fácil abuso de ella sobrearquitectura de las cosas 
Objeto
Es [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Programación Procedural </strong><br />
Instrucciones que generan procedimientos<br />
En ActionScript todo lo relacionado a funciones que generan tareas. </p>
<p><i>Pros</i><br />
- Implantación rápida, resultados rápidos</p>
<p><i>Contras</i><br />
- Poco mantenible a la larga, en aplicaciones con más de 500 líneas de código. </p>
<p><strong>Orientado a Objetos</strong><br />
Divide el código en entidades diferentes </p>
<p><i>Pros</i><br />
Escalables<br />
Metodología de programación </p>
<p><i>Contras</i><br />
Implantación lenta<br />
Fácil abuso de ella sobrearquitectura de las cosas </p>
<p><strong>Objeto</strong><br />
Es un subprograma que mantiene información y funcionalidad que maneja esa información que se está guardando<br />
A los datos se los conoce como propiedades y a las funciones cómo métodos. </p>
<p><strong>Clases</strong><br />
Plantilla para crear objetos<br />
Definición abstracta de lo que va a ser un objeto.<br />
Todos los objetos creados a partir de una misma clase van a tener los mismos métodos y propiedades.<br />
Lo que crea un objeto único o diferente a otro es el valor de las propiedades. </p>
<p>Clases sin propiedades se hacen estáticas como la clase Math. </p>
<p>Todo lo que se puede hacer en flash está encapsulado en clases. </p>
<p><strong>Paquetes</strong><br />
Un paquete puede contener otro paquete, clases o definiciones de funciones. </p>
<p><strong>1.- Paquete Flash</strong><br />
La utilización de este paquete no añade código ni peso a nuestra película. Se encuentra integrado dentro del flash player. </p>
<p><strong>2.- Librería FL</strong><br />
Son los componentes de flash. No viene compilada dentro del flash player. Hay que añadir el código a la película flash cuando usemos un componente.</p>
<p><strong>3.- Libería mx</strong><br />
Componentes de Flex </p>
<p>Sirven para organizar el código y para que no halla colisión entre nombres. </p>
<p><strong>Como crear un objeto a partir de una clase</strong> </p>
<p><strong>Operador new</strong> </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-39">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> punto:Point = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// instancia un objeto de la clase Point </span></div>
</div>
</div>
<p></p>
<p>Una vez instanciado el objeto podemos acceder a sus métodos y propiedades </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-40">
<div class="actionscript">punto.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">30</span>; <br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>punto<span style="color: #66cc66;">&#41;</span>;</p>
<p>punto.<span style="color: #006600;">offset</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">30</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Offset desplaza el punto </span><br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>punto<span style="color: #66cc66;">&#41;</span>; salida <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>El constructor puede recibir parámetros, si vienen entre corchetes, éstos son opcionales. </p>
<p>Si escribimos el código en línea de tiempo podemos usar los paquetes sin importarlos.<br />
Cuando trabajemos con clases tenemos que importar las clases. </p>
<p>import flash.geom.Point;<br />
import flash.geom.*; // importa el paquete entero </p>
<p>Importando una clase no se añade el código al swf. Si no tiene el paquete importado se va a ir al top level a buscar.<br />
En el momento de compilación busca las clases y las compila en el .swf </p>
<p>Cuando se instancia una clase flash va a mirar si es una clase del top level --> si no, se pone a mirar en las directivas import del código para buscar la clase. </p>
<p><strong>COMO CREAR UNA CLASE</strong><br />
creamos el nombre del paquete, si no va dentro de ningún paquete lo dejamos vacío pero usamos la declaración de package </p>
<p>Por cada archivo de ActionScript solo puede haber una definición o de función o de clase. </p>
<p><strong>CLASSPATH (rutas de clase)</strong><br />
Ruta donde va a buscar flash las clases en el disco. </p>
<p><i>1.- DE DOCUMENTO</i><br />
<i>2.- GLOBALES </i></p>
<p>Se configuran en preferencias --> ActionScript<br />
De manera predeterminada vienen dos classpath por defecto<br />
"." va a buscar en el mismo directorio que el propio archivo .fla<br />
$(AppConfig)/ActionScript 3.0/Classes va a buscar en el directorio Adobe Flash CS3 es<br />
Archivos .swc código precompilado ,no son más que archivos .zip con un archivo xml y otro swf </p>
<p>Podemos insertar los classpath que queramos </p>
<p>Librería Standard (Clases de Flash)<br />
Clases del proyecto (Clases que están al lado del fla)<br />
Nuestra librería de clases </p>
<p>En configuración de publicación en la pestaña de Flash tenemos tambien una Ruta de Clases, pero solo para ese archivo. </p>
<p>En configuración de publicación tenemos una pestaña que crea un SWC, código precompilado para dar al cliente cuando no queremos dar nuestras clases. </p>
<p><strong>ATRIBUTOS DE CONTROL DE ACCESO o Visibilidad</strong></p>
<p>Se usan tanto en propiedades como métodos, asigna quien puede utilizar esa función, clase o método. </p>
<p>public: cualquiera puede ver/utilizar esa definición<br />
private: solo se puede usar desde este código (desde esta clase), métodos de ayuda dentro de la clase. Pensado para uso interno.<br />
protected: lo pueden ver la clase y las subclases<br />
internal: solo puede ser visto por otras clases que estén dentro del mismo paquete. Es el valor por defecto cuando no ponemos ningún atributo. </p>
<p><strong>PROGRAMACIÓN ORIENTADA A OBJETOS</strong></p>
<p>CUALIDADES<br />
<i>1- Abstracción:</i><br />
Nunca se debería saber el funcionamiento de una clase para poder usarla. </p>
<p><i>2.- Encapsulamiento:</i><br />
Una clase no debería dejar modificar sus propiedades.<br />
No poner propiedades públicas. </p>
<p><i>3.- Herencia</i><br />
<i>4.- Polimorfismo</i> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/04/25/objetos-y-clases-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Polimorfismo &#8211; ActionScript 3.0</title>
		<link>http://www.robot04.com/blog/index.php/2009/04/25/polimorfismo-actionscript-30/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/04/25/polimorfismo-actionscript-30/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:14:06 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Apuntes que siempre se me olvidan]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=283</guid>
		<description><![CDATA[Capacidad de una clase para comportarse como diferentes tipos de clases. 
Se hace la diferencia entre tipo y clase, es decir, la clase círculo es del tipo FormaGeometrica. 
Actionscript:

var c:Circulo = new Circulo&#40;&#41;; // Círculo hereda de FormaGeometrica 
function medirAncho&#40;a:FormaGeometrica&#41; : void 
&#123; 
&#160; &#160; trace&#40;a.ancho&#41;; 
&#125; 
medirAncho&#40;c&#41;;



Esto es posible gracias al polimorfismo, el tipo [...]]]></description>
			<content:encoded><![CDATA[<p>Capacidad de una clase para comportarse como diferentes tipos de clases. </p>
<p>Se hace la diferencia entre tipo y clase, es decir, la clase círculo es del tipo FormaGeometrica. </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-43">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> c:Circulo = <span style="color: #000000; font-weight: bold;">new</span> Circulo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Círculo hereda de FormaGeometrica </span><br />
<span style="color: #000000; font-weight: bold;">function</span> medirAncho<span style="color: #66cc66;">&#40;</span>a:FormaGeometrica<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <br />
<span style="color: #66cc66;">&#123;</span> <br />
&nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>a.<span style="color: #006600;">ancho</span><span style="color: #66cc66;">&#41;</span>; <br />
<span style="color: #66cc66;">&#125;</span> <br />
medirAncho<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>Esto es posible gracias al polimorfismo, el tipo puede ser la superclase (FormaGeometrica) y el valor siempre será el objeto que pasemos, es decir, si como tipo ponemos la superclase podremos pasar como parámetro cualquiera de las subclases (Circulo, Cuadrado, Triangulo, etc). </p>
<p>Después con <strong>is</strong> podemos averiguar de que tipo es la clase y actuar de una forma u otra con ella.<br />
Pej.</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-44">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> medirAncho<span style="color: #66cc66;">&#40;</span>a:FormaGeometrica<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>a is Circle<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>a.<span style="color: #006600;">radius</span> * <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>a is Rectangle<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>a.<span style="color: #006600;">ancho</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Cuando hablamos de polimorfismo podemos decir: "Tiene un..."</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/04/25/polimorfismo-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Herencia &#8211; ActionScript 3.0</title>
		<link>http://www.robot04.com/blog/index.php/2009/04/25/herencia-actionscript-30/</link>
		<comments>http://www.robot04.com/blog/index.php/2009/04/25/herencia-actionscript-30/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:04:09 +0000</pubDate>
		<dc:creator>Robot04</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Apuntes que siempre se me olvidan]]></category>

		<guid isPermaLink="false">http://www.robot04.com/blog/?p=277</guid>
		<description><![CDATA[La herencia es una relación entre clases.
Permite que una clase herede la funcionalidad de otra (propiedades y métodos). 
A la clase superior se la conoce como clase superior o clase base. La clase que hereda se la conoce como subclase o extensión.
Una subclase solo puede tener una superclase.
Cuanto más se baja en la cadena de [...]]]></description>
			<content:encoded><![CDATA[<p>La herencia es una relación entre clases.<br />
Permite que una clase herede la funcionalidad de otra (propiedades y métodos). </p>
<p>A la clase superior se la conoce como clase superior o clase base. La clase que hereda se la conoce como subclase o extensión.<br />
<strong>Una subclase solo puede tener una superclase.</strong></p>
<p>Cuanto más se baja en la cadena de herencia se vuelven más especializadas las clases. </p>
<p>Desde una subclase no se puede acceder a las propiedades privadas de la superclase.</p>
<p>Podemos usar protected para acceder desde la subclase a una propiedad de la superclase, pero no permitir su acceso desde otros lugares. </p>
<p><strong>Public:</strong> permite acceder a propiedades y métodos desde cualquier sitio (miembros y clases)<br />
<strong>Protected:</strong> permite acceder desde dentro de la clase y sus subclases. (miembros)<br />
<strong>Private:</strong> solo permite desde la propia clase. (miembros)<br />
<strong>Internal:</strong> solo permite acceder desde el mismo paquete (miembros y clases) </p>
<p>* miembro: propiedades y métodos </p>
<p><strong>Atributos de clase</strong></p>
<p>final<br />
dynamic<br />
internal<br />
public</p>
<p>El atributo final se usa para que no se pueda heredar de una clase.<br />
Dynamic indica que esa clase puede tener propiedades dinámicas (ej. Object, MovieClip).</p>
<p><strong>LOS MÉTODOS Y PROPIEDADES ESTÁTICOS NO SE HEREDAN</strong></p>
<p><strong>Override</strong><br />
Si creamos un método en la subclase con el mismo nombre que en la superclase nos sale un error para evitar problemas.<br />
Para sobreescribir un método de la superclase tenemos que marcarla como override en la subclase, después podremos ejecutar el código del método de la superclase escribiendo super. </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-47">
<div class="actionscript"><span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> metodo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <br />
<span style="color: #66cc66;">&#123;</span> <br />
&nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Método de la clase base"</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Si además queremos que se ejecute el código de la clase superior al hacer el override podemos usar super.<br />
Para poder ocultar un método con override el método debe tener la misma firma que la superclase (exacta). </p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-48">
<div class="actionscript"><span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> metodo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <br />
<span style="color: #66cc66;">&#123;</span> <br />
&nbsp; &nbsp; <span style="color: #0066CC;">super</span>.<span style="color: #006600;">metodo</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Método de la subclase"</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Cuando hablamos de herencia podemos decir: "Es un..."<br />
Ej. Un Ferrari <strong>es un</strong> deportivo que a su vez es un coche </p>
<p><strong>Donde utilizamos una superclase podemos usar una subclase.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robot04.com/blog/index.php/2009/04/25/herencia-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
