<?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>CODIGO.actionscript &#187; Básico</title>
	<atom:link href="http://www.codigoactionscript.org/category/actionscript-basico/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codigoactionscript.org</link>
	<description>Blog de programación en ActionScript. Tips, tutoriales, ejemplos de Adobe Flash, Flex y AIR</description>
	<lastBuildDate>Mon, 31 May 2010 14:58:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cómo crear transiciones entre fotogramas en Flash</title>
		<link>http://www.codigoactionscript.org/como-crear-transiciones-entre-fotogramas-en-flash/</link>
		<comments>http://www.codigoactionscript.org/como-crear-transiciones-entre-fotogramas-en-flash/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 03:33:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/como-crear-transiciones-entre-fotogramas-en-flash/</guid>
		<description><![CDATA[<p>Hace unos días me preguntaron como crear transiciones entre fotogramas en Flash. Esto es una tarea bastante sencilla de implementar así que aprovecho para explicarla en forma de Tip.</p>
<p>Lo que se pretende conseguir es que al cambiar de fotograma, los elementos del fotograma actual desaparezcan de forma animada antes de saltar al siguiente fotograma. Como se ve en el ejemplo: </p>
     
Clicka en los botones de colores
<p>Esta sencilla película está estructurada en varios fotogramas con un elemento diferente en cada uno de ellos y una serie [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/asignar-codigo-actionscript-en-clases-a-fotogramas-concretos/' rel='bookmark' title='Permanent Link: Asignar código actionscript en clases a fotogramas concretos'>Asignar código actionscript en clases a fotogramas concretos</a></li>
<li><a href='http://www.codigoactionscript.org/crear-una-aplicacion-apollo-con-flash-cs3/' rel='bookmark' title='Permanent Link: Crear una aplicación Apollo con Flash CS3'>Crear una aplicación Apollo con Flash CS3</a></li>
<li><a href='http://www.codigoactionscript.org/sistema-de-transiciones-entre-fotos/' rel='bookmark' title='Permanent Link: Sistema de transiciones entre fotos'>Sistema de transiciones entre fotos</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hace unos días <a href="http://www.facebook.com/group.php?gid72891900125#/topic.php?uid72891900125&#038;topic57112">me preguntaron</a> como <strong>crear transiciones entre fotogramas</strong> en <a href="http://www.cristalab.com/tips/tags/flash">Flash</a>. Esto es una tarea bastante sencilla de implementar así que aprovecho para explicarla en forma de <a href="http://www.cristalab.com/tips">Tip</a>.</p>
<p>Lo que se pretende conseguir es que al cambiar de fotograma, los elementos del fotograma actual desaparezcan de forma animada antes de saltar al siguiente fotograma. Como se ve en el ejemplo: </p>
<div align="center"><div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="" height="">  <param name="movie" value="http://www.cristalab.com/images/tips/actionscript_3/frameTransition/tip.swf" />  <param name="quality" value="high" /> <embed src="http://www.cristalab.com/images/tips/actionscript_3/frameTransition/tip.swf" width="" height="" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object></div><br />
<em>Clicka en los botones de colores</em></div>
<p>Esta sencilla película está estructurada en varios fotogramas con un elemento diferente en cada uno de ellos y una serie de botones que nos hacen saltar de uno a otro.</p>
<div align="center"><img src="http://l4c.me/uploads/cap-005-1263758452_full550.jpg" alt="" /></div>
<p>La idea del ejemplo es que cada fotograma esté contenido en un MovieClip que contenga a su vez la animación de entrada y salida. Y por código haremos que se reproduzcan estas animaciones al cambiar de fotograma.</p>
<p>En el primer fotograma del MovieClip tendremos todo su contenido tal cual nos interese tener en pantalla, y apartir del segundo fotograma haremos la animación de entrada y salida. </p>
<p>Para este ejemplo la animación de entrada y salida será la misma interpolación de movimiento que reproduciremos adelante o hacia atrás según sea el caso.</p>
<div align="center"><img src="http://l4c.me/uploads/cap-003-1263758379_full550.jpg" alt="" /></div>
<p>Para poder referenciar el código colocaremos un Label "on" en el primer frame de la animación, un Label "anim" en los fotogramas internos de la animación, y un Label "out" en el último fotograma de la animación.</p>
<div align="center"><img src="http://l4c.me/uploads/cap-004-1263758416_full550.jpg" alt="" /></div>
<p>[h3]Ahora vayamos al código:[/h3]</p>
<p>Empezaremos por la clase Main.as, que es la clase de la pelicula y donde asignaremos los comportamientos a los botones:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-5">
<div class="actionscript">package <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</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: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> currentFrameClip:<span style="color: #0066CC;">MovieClip</span>;</p>
<p>&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> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">boton1</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,gotoFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">boton2</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,gotoFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">boton3</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,gotoFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">boton4</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,gotoFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">stop</span><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> gotoFrame<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> boton1 :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentFrameClip.<span style="color: #006600;">gotoFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> boton2 :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentFrameClip.<span style="color: #006600;">gotoFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> boton3 :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentFrameClip.<span style="color: #006600;">gotoFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> boton4 :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentFrameClip.<span style="color: #006600;">gotoFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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>
</div>
<p>
Aquí lo único que hacemos es que los botones de la película hagan ejecutar al MovieClip, referenciado desde una variable "<em>currentFrameClip</em>", un método llamado "<em>gotoFrame</em>", que como su nombre indica nos hará saltar al fotograma pasado como parámetro.</p>
<p>Vayamos ahora a la clase que asignaremos a cada uno de los MovieClip de los fotogramas y que es la que hará reproducir la animación y saltar de fotograma:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-6">
<div class="actionscript">package <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FrameInOut <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">goto</span>:uint;<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> FrameInOut<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">parent</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">currentFrameClip</span>=<span style="color: #0066CC;">this</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; frameIntro<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> gotoFrame<span style="color: #66cc66;">&#40;</span>frame:uint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>frame!=<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">parent</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">currentFrame</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">goto</span>=frame;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"on"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,avanzaFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//-----------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> frameIntro<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"out"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,retrocedeFrame<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> retrocedeFrame<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">currentLabel</span>==<span style="color: #ff0000;">"on"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,retrocedeFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">prevFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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> avanzaFrame<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">currentLabel</span>==<span style="color: #ff0000;">"out"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,avanzaFrame<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">parent</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">goto</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">nextFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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>
</div>
<p></p>
<p>Esta clase lo que hace es guardar el valor del fotograma al que debe de saltar. Luego reproduce la animación de salida desplazandose desde el Label "on" al Label "out", y es entonces cuando llama ejecutar el gotoAndStop que hace cambiar de fotograma. </p>
<p>El contructor de la clase también tiene una llamada a una función que hace reproducir la animación de entrada creandose así la transición de un fotograma al otro.</p>
<p>Aquí puedes <a href="http://www.cristalab.com/images/tips/actionscript_3/frameTransition/FrameInOut.zip">descargarte el archivo</a>.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=C%C3%B3mo%20crear%20transiciones%20entre%20fotogramas%20en%20Flash%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F&amp;t=C%C3%B3mo%20crear%20transiciones%20entre%20fotogramas%20en%20Flash" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F&amp;title=C%C3%B3mo%20crear%20transiciones%20entre%20fotogramas%20en%20Flash&amp;annotation=Hace%20unos%20d%C3%ADas%20%20como%20%20en%20.%20Esto%20es%20una%20tarea%20bastante%20sencilla%20de%20implementar%20as%C3%AD%20que%20aprovecho%20para%20explicarla%20en%20forma%20de%20.%0D%0A%0D%0ALo%20que%20se%20pretende%20conseguir%20es%20que%20al%20cambiar%20de%20fotograma%2C%20los%20elementos%20del%20fotograma%20actual%20desaparezcan%20de%20forma%20a" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F&amp;title=C%C3%B3mo%20crear%20transiciones%20entre%20fotogramas%20en%20Flash&amp;notes=Hace%20unos%20d%C3%ADas%20%20como%20%20en%20.%20Esto%20es%20una%20tarea%20bastante%20sencilla%20de%20implementar%20as%C3%AD%20que%20aprovecho%20para%20explicarla%20en%20forma%20de%20.%0D%0A%0D%0ALo%20que%20se%20pretende%20conseguir%20es%20que%20al%20cambiar%20de%20fotograma%2C%20los%20elementos%20del%20fotograma%20actual%20desaparezcan%20de%20forma%20a" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=C%C3%B3mo%20crear%20transiciones%20entre%20fotogramas%20en%20Flash&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-crear-transiciones-entre-fotogramas-en-flash%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/asignar-codigo-actionscript-en-clases-a-fotogramas-concretos/' rel='bookmark' title='Permanent Link: Asignar código actionscript en clases a fotogramas concretos'>Asignar código actionscript en clases a fotogramas concretos</a></li>
<li><a href='http://www.codigoactionscript.org/crear-una-aplicacion-apollo-con-flash-cs3/' rel='bookmark' title='Permanent Link: Crear una aplicación Apollo con Flash CS3'>Crear una aplicación Apollo con Flash CS3</a></li>
<li><a href='http://www.codigoactionscript.org/sistema-de-transiciones-entre-fotos/' rel='bookmark' title='Permanent Link: Sistema de transiciones entre fotos'>Sistema de transiciones entre fotos</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/como-crear-transiciones-entre-fotogramas-en-flash/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Visualizar menús desplegables HTML por encima de películas Flash</title>
		<link>http://www.codigoactionscript.org/visualizar-menus-desplegables-html-por-encima-de-peliculas-flash/</link>
		<comments>http://www.codigoactionscript.org/visualizar-menus-desplegables-html-por-encima-de-peliculas-flash/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 20:29:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[dreamweaver]]></category>
		<category><![CDATA[spry]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=526</guid>
		<description><![CDATA[<p>Este es otro tip "only for dummies", que es muy sencillo pero que da dolores de cabeza a la gente que apenas se inicia en el mundo de Ajax únicamente utilizando los códigos automáticos de Spry que trae Dreamweaver.</p>
<p>El problema que muchos se encuentran es que los menús desplegables les quedan por debajo de las peliculas Flash, aun estando está en un index inferior.</p>

<p>Esto tiene una solución muy sencilla, y pasa por añadirle la propiedad wmode de la pelicula Flash a valor invisible.</p>
<p>De manera que si estamos utilizando SwfObject para [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/sustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax/' rel='bookmark' title='Permanent Link: Sustituir un SWF por otro sin refrescar el HTML con Ajax'>Sustituir un SWF por otro sin refrescar el HTML con Ajax</a></li>
<li><a href='http://www.codigoactionscript.org/51/' rel='bookmark' title='Permanent Link: Texto con enlaces en Flash al estilo HTML'>Texto con enlaces en Flash al estilo HTML</a></li>
<li><a href='http://www.codigoactionscript.org/el-nuevo-motor-de-texto-text-layout-framework-de-flash-cs5/' rel='bookmark' title='Permanent Link: El nuevo motor de texto (Text Layout Framework) de Flash CS5'>El nuevo motor de texto (Text Layout Framework) de Flash CS5</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Este es otro <a href="http://www.cristalab.com/tips/tags/php">tip</a> "<em>only for dummies"</em>, que es muy sencillo pero que da dolores de cabeza a la gente que apenas se inicia en el mundo de <a href="http://www.cristalab.com/tips/tags/ajax">Ajax</a> únicamente utilizando los códigos automáticos de <a href="http://www.cristalab.com/tips/tags/spry">Spry</a> que trae <a href="http://www.cristalab.com/tips/tags/dreamweaver">Dreamweaver</a>.</p>
<p>El problema que muchos se encuentran es que los menús desplegables les quedan por debajo de las peliculas <a href="http://www.cristalab.com/tips/tags/flash">Flash</a>, aun estando está en un index inferior.</p>
<div align="center"><img src="http://www.cristalab.com/images/tips//html/divflash/cap_020.jpg" alt="" /></div>
<p>Esto tiene una solución muy sencilla, y pasa por añadirle la propiedad <strong>wmode</strong> de la pelicula Flash a valor invisible.</p>
<p>De manera que si estamos utilizando <a href="http://www.cristalab.com/tips/tags/swfobject">SwfObject</a> para colocar el SWF, utilizariamos este código:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-8">
<div class="actionscript">&lt;script <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">"text/javascript"</span>&gt;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">var</span> flashvars = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">var</span> params = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">attributes</span> = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;params.<span style="color: #006600;">wmode</span> = <span style="color: #ff0000;">"transparent"</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;swfobject.<span style="color: #006600;">embedSWF</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"a.swf"</span>, <span style="color: #ff0000;">"flash"</span>, <span style="color: #ff0000;">"320"</span>, <span style="color: #ff0000;">"240"</span>, <span style="color: #ff0000;">"10.0.0"</span>, <span style="color: #ff0000;">"expressInstall.swf"</span>, flashvars, params, <span style="color: #0066CC;">attributes</span><span style="color: #66cc66;">&#41;</span>;<br />
&lt;/script&gt;</div>
</div>
</div>
</div>
<p></p>
<p>Esta línea de código es suficiente para resolver el problema.</p>
<div align="center"><img src="http://www.cristalab.com/images/tips//html/divflash/cap_021.jpg" alt="" /></div>
<p><a href="http://www.cristalab.com/images/tips//html/divflash/#">Aqui el ejemplo</a>, por si alguien lo quiere ver <img src='http://www.codigoactionscript.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Visualizar%20men%C3%BAs%20desplegables%20HTML%20por%20encima%20de%20pel%C3%ADculas%20Flash%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F&amp;t=Visualizar%20men%C3%BAs%20desplegables%20HTML%20por%20encima%20de%20pel%C3%ADculas%20Flash" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F&amp;title=Visualizar%20men%C3%BAs%20desplegables%20HTML%20por%20encima%20de%20pel%C3%ADculas%20Flash&amp;annotation=Este%20es%20otro%20%20%22%2C%20que%20es%20muy%20sencillo%20pero%20que%20da%20dolores%20de%20cabeza%20a%20la%20gente%20que%20apenas%20se%20inicia%20en%20el%20mundo%20de%20%20%C3%BAnicamente%20utilizando%20los%20c%C3%B3digos%20autom%C3%A1ticos%20de%20%20que%20trae%20.%0D%0A%0D%0AEl%20problema%20que%20muchos%20se%20encuentran%20es%20que%20los%20men%C3%BAs%20desplegables%20" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F&amp;title=Visualizar%20men%C3%BAs%20desplegables%20HTML%20por%20encima%20de%20pel%C3%ADculas%20Flash&amp;notes=Este%20es%20otro%20%20%22%2C%20que%20es%20muy%20sencillo%20pero%20que%20da%20dolores%20de%20cabeza%20a%20la%20gente%20que%20apenas%20se%20inicia%20en%20el%20mundo%20de%20%20%C3%BAnicamente%20utilizando%20los%20c%C3%B3digos%20autom%C3%A1ticos%20de%20%20que%20trae%20.%0D%0A%0D%0AEl%20problema%20que%20muchos%20se%20encuentran%20es%20que%20los%20men%C3%BAs%20desplegables%20" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Visualizar%20men%C3%BAs%20desplegables%20HTML%20por%20encima%20de%20pel%C3%ADculas%20Flash&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fvisualizar-menus-desplegables-html-por-encima-de-peliculas-flash%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/sustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax/' rel='bookmark' title='Permanent Link: Sustituir un SWF por otro sin refrescar el HTML con Ajax'>Sustituir un SWF por otro sin refrescar el HTML con Ajax</a></li>
<li><a href='http://www.codigoactionscript.org/51/' rel='bookmark' title='Permanent Link: Texto con enlaces en Flash al estilo HTML'>Texto con enlaces en Flash al estilo HTML</a></li>
<li><a href='http://www.codigoactionscript.org/el-nuevo-motor-de-texto-text-layout-framework-de-flash-cs5/' rel='bookmark' title='Permanent Link: El nuevo motor de texto (Text Layout Framework) de Flash CS5'>El nuevo motor de texto (Text Layout Framework) de Flash CS5</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/visualizar-menus-desplegables-html-por-encima-de-peliculas-flash/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Sustituir un SWF por otro sin refrescar el HTML con Ajax</title>
		<link>http://www.codigoactionscript.org/sustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax/</link>
		<comments>http://www.codigoactionscript.org/sustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 23:16:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=519</guid>
		<description><![CDATA[<p>En este sencillo ejemplo mostraré como sustituir un archivo SWF de una página HTML por otro sin necesidad de refrescar la página. (ejemplo)</p>
<p>Para ello utilizaremos SwfObject y JQuery. En realidad JQuery no haria falta utilizarlo ya que quien sustituirá el SWF será SwfObject y podriamos hacer la llamada con una simple funcion Javascript. Pero nunca está de más ver un poco de Ajax</p>
<p>Para empezar nos descargaremos las librerias:</p>

http://code.google.com/p/swfobject/downloads/list
 http://docs.jquery.com/Downloading_jQuery#Download_jQuery

<p>.
Lo primero será colocar nuestra pelicula SWF dentro de la página HTML con SwfObject de la forma típica. Creando una DIV y [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/visualizar-menus-desplegables-html-por-encima-de-peliculas-flash/' rel='bookmark' title='Permanent Link: Visualizar menús desplegables HTML por encima de películas Flash'>Visualizar menús desplegables HTML por encima de películas Flash</a></li>
<li><a href='http://www.codigoactionscript.org/51/' rel='bookmark' title='Permanent Link: Texto con enlaces en Flash al estilo HTML'>Texto con enlaces en Flash al estilo HTML</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>En este sencillo ejemplo mostraré como <strong>sustituir un archivo SWF</strong> de una página HTML por otro <strong>sin necesidad de refrescar la página</strong>. (<a href="http://www.cristalab.com/zguillez/ajax/putswf/index.html">ejemplo</a>)</p>
<p>Para ello utilizaremos <a href="http://www.cristalab.com/tips/tags/swfobject">SwfObject</a> y JQuery. En realidad <a href="http://www.cristalab.com/tips/tags/jquery">JQuery</a> no haria falta utilizarlo ya que quien sustituirá el SWF será SwfObject y podriamos hacer la llamada con una simple funcion <a href="http://www.cristalab.com/tips/tags/javascript">Javascript</a>. Pero nunca está de más ver un poco de <a href="http://www.cristalab.com/tips/tags/ajax">Ajax</a></p>
<p>Para empezar nos descargaremos las librerias:</p>
<ul>
<li><a href="http://code.google.com/p/swfobject/downloads/list">http://code.google.com/p/swfobject/downloads/list</a></li>
<li> <a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery">http://docs.jquery.com/Downloading_jQuery#Download_jQuery</a></li>
</ul>
<p>.<br />
Lo primero será colocar nuestra pelicula SWF dentro de la página HTML con SwfObject de la forma típica. Creando una DIV y asignandole ahí la pelicula SWF. Lo haremos creando una función que reciba el parámetro de la URL del SWF para poder volver a llamar esa función más adelante:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-19">
<div class="actionscript">&lt;script src=<span style="color: #ff0000;">"swfobject.js"</span> <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">"text/javascript"</span>&gt;&lt;/script&gt; &lt;script <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">"text/javascript"</span>&gt;<span style="color: #808080; font-style: italic;">// &lt;![CDATA[</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> putSWF<span style="color: #66cc66;">&#40;</span>swf<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; swfobject.<span style="color: #006600;">embedSWF</span><span style="color: #66cc66;">&#40;</span>swf, <span style="color: #ff0000;">"flash"</span>, <span style="color: #ff0000;">"320"</span>, <span style="color: #ff0000;">"240"</span>, <span style="color: #ff0000;">"10.0.0"</span>, <span style="color: #ff0000;">"expressInstall.swf"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putSWF<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"a.swf"</span><span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #808080; font-style: italic;">// ]]&gt;&lt;/script&gt; </span></div>
</div>
</div>
</div>
<p></p>
<p>Ahora crearemos unos cuantos links con los que queremos cambiar de pelicula SWF pero sin cambiar de página HTML. Los colocaremos en otro DIV y asignaremos a cada enlace un ID diferente:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-20">
<div class="actionscript">&lt;div id=<span style="color: #ff0000;">"botonera"</span>&gt;</p>
<p>&lt;a id=<span style="color: #ff0000;">"a"</span> href=<span style="color: #ff0000;">"#"</span>&gt;a.<span style="color: #006600;">swf</span>&lt;/a&gt;<br />
- &lt;a id=<span style="color: #ff0000;">"b"</span> href=<span style="color: #ff0000;">"#"</span>&gt;b.<span style="color: #006600;">swf</span>&lt;/a&gt;<br />
- &lt;a id=<span style="color: #ff0000;">"c"</span> href=<span style="color: #ff0000;">"#"</span>&gt;c.<span style="color: #006600;">swf</span>&lt;/a&gt;&lt;/div&gt;</div>
</div>
</div>
</div>
<p></p>
<p>Podríamos hacer que cada enlace volviera a ejecutar la función Javascript y listo, pero haremos el ejemplo más c00l utilizando JQuery.</p>
<p>Primero definiremos un objeto en el que guardaremos una relación entre los ID de los enlaces y la pelicula SWF que han de abrir.</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-21">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> swfRef = <span style="color: #66cc66;">&#123;</span><br />
a: <span style="color: #ff0000;">"a.swf"</span>,<br />
b: <span style="color: #ff0000;">"b.swf"</span>,<br />
c: <span style="color: #ff0000;">"c.swf"</span><br />
<span style="color: #66cc66;">&#125;</span>;</div>
</div>
</div>
</div>
<p></p>
<p>Y por último crearemos una función de JQuery que asignará a cada enlace la llamada a la función Javascript pasandole el parámetro que toca. Tambien sustituiremos la primera llamada.</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-22">
<div class="actionscript">$<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
$.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span>swfRef, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>i, val<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
$<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"#"</span> + i<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">click</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
putSWF<span style="color: #66cc66;">&#40;</span>val<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
$<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"#a"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">click</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
</div>
<p></p>
<p>Y listo, ahora cada enlace sustituye el SWF por otro dentro de la misma página.</p>
<p>Aqui se puede ver el ejemplo: <a href="http://www.cristalab.com/zguillez/ajax/putswf/index.html">http://www.cristalab.com/zguillez/ajax/putswf/index.html</a></p>
<p>Y el código completo:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-23">
<div class="actionscript">&lt;html&gt;<br />
&nbsp; &nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> src=<span style="color: #ff0000;">"swfobject.js"</span>&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script src=<span style="color: #ff0000;">"lib/jquery/jquery-1.3.2.js"</span>&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> putSWF<span style="color: #66cc66;">&#40;</span>swf<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; swfobject.<span style="color: #006600;">embedSWF</span><span style="color: #66cc66;">&#40;</span>swf, <span style="color: #ff0000;">"flash"</span>, <span style="color: #ff0000;">"320"</span>, <span style="color: #ff0000;">"240"</span>, <span style="color: #ff0000;">"10.0.0"</span>, <span style="color: #ff0000;">"expressInstall.swf"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> swfRef = <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; a: <span style="color: #ff0000;">"a.swf"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b: <span style="color: #ff0000;">"b.swf"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c: <span style="color: #ff0000;">"c.swf"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span>swfRef, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>i, val<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"#"</span> + i<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">click</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putSWF<span style="color: #66cc66;">&#40;</span>val<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"#a"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">click</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/script&gt;<br />
&nbsp; &nbsp; &lt;/head&gt;<br />
&nbsp; &nbsp; &lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=<span style="color: #ff0000;">"botonera"</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a id=<span style="color: #ff0000;">"a"</span> href=<span style="color: #ff0000;">"#"</span>&gt;a.<span style="color: #006600;">swf</span>&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - &lt;a id=<span style="color: #ff0000;">"b"</span> href=<span style="color: #ff0000;">"#"</span>&gt;b.<span style="color: #006600;">swf</span>&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - &lt;a id=<span style="color: #ff0000;">"c"</span> href=<span style="color: #ff0000;">"#"</span>&gt;c.<span style="color: #006600;">swf</span>&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/p&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=<span style="color: #ff0000;">"flash"</span>&gt;&lt;/div&gt;<br />
&nbsp; &nbsp; &lt;/body&gt;<br />
&lt;/html&gt;</div>
</div>
</div>
</div>
<p></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Sustituir%20un%20SWF%20por%20otro%20sin%20refrescar%20el%20HTML%20con%20Ajax%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F&amp;t=Sustituir%20un%20SWF%20por%20otro%20sin%20refrescar%20el%20HTML%20con%20Ajax" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F&amp;title=Sustituir%20un%20SWF%20por%20otro%20sin%20refrescar%20el%20HTML%20con%20Ajax&amp;annotation=En%20este%20sencillo%20ejemplo%20mostrar%C3%A9%20como%20%20de%20una%20p%C3%A1gina%20HTML%20por%20otro%20.%20%28%29%0D%0A%0D%0APara%20ello%20utilizaremos%20%20y%20JQuery.%20En%20realidad%20%20no%20haria%20falta%20utilizarlo%20ya%20que%20quien%20sustituir%C3%A1%20el%20SWF%20ser%C3%A1%20SwfObject%20y%20podriamos%20hacer%20la%20llamada%20con%20una%20simple%20funcion" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F&amp;title=Sustituir%20un%20SWF%20por%20otro%20sin%20refrescar%20el%20HTML%20con%20Ajax&amp;notes=En%20este%20sencillo%20ejemplo%20mostrar%C3%A9%20como%20%20de%20una%20p%C3%A1gina%20HTML%20por%20otro%20.%20%28%29%0D%0A%0D%0APara%20ello%20utilizaremos%20%20y%20JQuery.%20En%20realidad%20%20no%20haria%20falta%20utilizarlo%20ya%20que%20quien%20sustituir%C3%A1%20el%20SWF%20ser%C3%A1%20SwfObject%20y%20podriamos%20hacer%20la%20llamada%20con%20una%20simple%20funcion" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Sustituir%20un%20SWF%20por%20otro%20sin%20refrescar%20el%20HTML%20con%20Ajax&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fsustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/visualizar-menus-desplegables-html-por-encima-de-peliculas-flash/' rel='bookmark' title='Permanent Link: Visualizar menús desplegables HTML por encima de películas Flash'>Visualizar menús desplegables HTML por encima de películas Flash</a></li>
<li><a href='http://www.codigoactionscript.org/51/' rel='bookmark' title='Permanent Link: Texto con enlaces en Flash al estilo HTML'>Texto con enlaces en Flash al estilo HTML</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/sustituir-un-swf-por-otro-sin-refrescar-el-html-con-ajax/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Panel de zoom de imágenes en Flex</title>
		<link>http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-flex/</link>
		<comments>http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-flex/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 21:04:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[componente]]></category>
		<category><![CDATA[mxml]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=391</guid>
		<description><![CDATA[<p>Este ejemplo es, igual que hice en el post anterior, un ejemplo que he adaptado a Flex desde un ejemplo que hice hace tiempo para Flash. Se trata de un panel donde se ve un zoom de una parte de una imagen.</p>
<p>Este es el ejemplo montado en Flex:
</p>
<p>Y este es el código utilizado para la película principal:</p>



&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; xmlns:ui="*"
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; layout="absolute"
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; creationComplete="ini()"
&#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flex/' rel='bookmark' title='Permanent Link: Ejemplo de Zoom con lupa en Flex'>Ejemplo de Zoom con lupa en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-actionscript-3/' rel='bookmark' title='Permanent Link: Panel de zoom de imágenes en ActionScript 3'>Panel de zoom de imágenes en ActionScript 3</a></li>
<li><a href='http://www.codigoactionscript.org/drag-and-drop-en-as3/' rel='bookmark' title='Permanent Link: Drag and Drop en AS3'>Drag and Drop en AS3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Este ejemplo es, igual que hice en el <a href="http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flex/">post anterior</a>, un ejemplo que he adaptado a Flex desde un <a href="http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-actionscript-3/">ejemplo que hice hace tiempo</a> para Flash. Se trata de un panel donde se ve un zoom de una parte de una imagen.</p>
<p>Este es el ejemplo montado en Flex:<br />
<object width="505" height="260"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.codigoactionscript.org/files/EfectoZoomFlex/EfectoZoom.swf" /><embed src="http://www.codigoactionscript.org/files/EfectoZoomFlex/EfectoZoom.swf" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="505" height="260"></embed></object></p>
<p>Y este es el código utilizado para la película principal:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-32">
<div class="actionscript">&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:ui=<span style="color: #ff0000;">"*"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layout=<span style="color: #ff0000;">"absolute"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; creationComplete=<span style="color: #ff0000;">"ini()"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"505"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"260"</span>&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> ZoomFx;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _zoom:ZoomFx;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> ini<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _zoom=<span style="color: #000000; font-weight: bold;">new</span> ZoomFx<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, fotoZoom, panelZoom<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:HBox horizontalCenter=<span style="color: #ff0000;">"0"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; verticalCenter=<span style="color: #ff0000;">"0"</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;ui:FotoZoom id=<span style="color: #ff0000;">"fotoZoom"</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;ui:PanelZoom id=<span style="color: #ff0000;">"panelZoom"</span>/&gt;<br />
&nbsp; &nbsp; &lt;/mx:HBox&gt;</p>
<p>&lt;/mx:Application&gt;</p></div>
</div>
</div>
</div>
<p></p>
<p>Este sería el componente que contiene la foto en grande:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-33">
<div class="actionscript">&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?&gt;<br />
&lt;mx:Canvas xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"350"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"250"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; borderStyle=<span style="color: #ff0000;">"solid"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; borderThickness=<span style="color: #ff0000;">"1"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">"#000000"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; horizontalScrollPolicy=<span style="color: #ff0000;">"off"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; verticalScrollPolicy=<span style="color: #ff0000;">"off"</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:Image id=<span style="color: #ff0000;">"foto"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;scaleContent=<span style="color: #ff0000;">"false"</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:source&gt;img/Waterfall.<span style="color: #006600;">jpg</span>&lt;/mx:source&gt;<br />
&nbsp; &nbsp; &lt;/mx:Image&gt;</p>
<p>&lt;/mx:Canvas&gt;</p></div>
</div>
</div>
</div>
<p></p>
<p>Y este el componente que contiene el panel de preview:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-34">
<div class="actionscript">&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?&gt;<br />
&lt;mx:Canvas xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"140"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"100"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; borderStyle=<span style="color: #ff0000;">"solid"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; borderThickness=<span style="color: #ff0000;">"1"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">"#000000"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; horizontalScrollPolicy=<span style="color: #ff0000;">"off"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; verticalScrollPolicy=<span style="color: #ff0000;">"off"</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:Image id=<span style="color: #ff0000;">"foto"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;scaleContent=<span style="color: #ff0000;">"true"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"140"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"100"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;horizontalCenter=<span style="color: #ff0000;">"0"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;verticalCenter=<span style="color: #ff0000;">"0"</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:source&gt;img/Waterfall.<span style="color: #006600;">jpg</span>&lt;/mx:source&gt;<br />
&nbsp; &nbsp; &lt;/mx:Image&gt;<br />
&nbsp; &nbsp; &lt;mx:Canvas x=<span style="color: #ff0000;">"0"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; y=<span style="color: #ff0000;">"0"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"70"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"50"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">"#FF0000"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; backgroundAlpha=<span style="color: #ff0000;">"0.5"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; borderStyle=<span style="color: #ff0000;">"solid"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; borderThickness=<span style="color: #ff0000;">"1"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">"#FF0000"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; id=<span style="color: #ff0000;">"zoomDrag"</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Canvas&gt;<br />
&lt;/mx:Canvas&gt;</div>
</div>
</div>
</div>
<p></p>
<p>Solo quedaría la clase de que controla el efecto:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-35">
<div class="actionscript">package<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">containers</span>.<span style="color: #006600;">Canvas</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">Image</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">Alert</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ZoomFx<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> _stage:UIComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _fotoZoom:UIComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _panelZoom:UIComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _distX:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _distY:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _porcentajeX:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _porcentajeY:<span style="color: #0066CC;">Number</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//----------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ZoomFx<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span>:UIComponent, fotoZoom:UIComponent, panelZoom:UIComponent<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _stage=<span style="color: #0066CC;">stage</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _fotoZoom=fotoZoom;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _panelZoom=panelZoom;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iniZoomDrag<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> iniZoomDrag<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; <span style="color: #000000; font-weight: bold;">var</span> drag:Canvas=_panelZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"zoomDrag"</span><span style="color: #66cc66;">&#41;</span> as Canvas;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, onStartDrag<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, onStopDrag<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_OUT</span>, onStopDrag<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> onStartDrag<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<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: #000000; font-weight: bold;">var</span> canvas:Canvas=<span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span> as Canvas;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; canvas.<span style="color: #0066CC;">startDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _stage.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span>, onMouseDragMove<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> onStopDrag<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<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: #000000; font-weight: bold;">var</span> canvas:Canvas=<span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span> as Canvas;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; canvas.<span style="color: #0066CC;">stopDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _stage.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span>, onMouseDragMove<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> onMouseDragMove<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<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; calculaDist<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mueveVisorZona<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; controlaPosiciones<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: #808080; font-style: italic;">//-------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> calculaDist<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; <span style="color: #000000; font-weight: bold;">var</span> drag:Canvas=_panelZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"zoomDrag"</span><span style="color: #66cc66;">&#41;</span> as Canvas;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> foto:Image=_fotoZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span> as Image;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _porcentajeX=<span style="color: #cc66cc;">100</span> / <span style="color: #66cc66;">&#40;</span>foto.<span style="color: #0066CC;">width</span> / _panelZoom.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _porcentajeY=<span style="color: #cc66cc;">100</span> / <span style="color: #66cc66;">&#40;</span>foto.<span style="color: #0066CC;">height</span> / _panelZoom.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #0066CC;">width</span>=_fotoZoom.<span style="color: #0066CC;">width</span> * _porcentajeX / <span style="color: #cc66cc;">100</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #0066CC;">height</span>=_fotoZoom.<span style="color: #0066CC;">height</span> * _porcentajeY / <span style="color: #cc66cc;">100</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _distX=drag.<span style="color: #006600;">x</span> * <span style="color: #cc66cc;">100</span> / _porcentajeX;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _distY=drag.<span style="color: #006600;">y</span> * <span style="color: #cc66cc;">100</span> / _porcentajeY;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _distX=<span style="color: #66cc66;">&#40;</span>_distX &lt;<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #cc66cc;">0</span> : _distX;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _distY=<span style="color: #66cc66;">&#40;</span>_distY &lt;<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #cc66cc;">0</span> : _distY;<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> mueveVisorZona<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; <span style="color: #000000; font-weight: bold;">var</span> drag:Canvas=_panelZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"zoomDrag"</span><span style="color: #66cc66;">&#41;</span> as Canvas;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> foto:Image=_fotoZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span> as Image;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foto.<span style="color: #006600;">x</span>=-_distX;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foto.<span style="color: #006600;">y</span>=-_distY;<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> controlaPosiciones<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; <span style="color: #000000; font-weight: bold;">var</span> drag:Canvas=_panelZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"zoomDrag"</span><span style="color: #66cc66;">&#41;</span> as Canvas;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> foto:Image=_fotoZoom.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span> as Image;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>drag.<span style="color: #006600;">x</span> &lt;<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>drag.<span style="color: #006600;">x</span>&gt; _panelZoom.<span style="color: #0066CC;">width</span> - drag.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">x</span>=_panelZoom.<span style="color: #0066CC;">width</span> - drag.<span style="color: #0066CC;">width</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>drag.<span style="color: #006600;">y</span> &lt;_panelZoom.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">y</span>=_panelZoom.<span style="color: #006600;">y</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>drag.<span style="color: #006600;">y</span>&gt; _panelZoom.<span style="color: #006600;">y</span> + _panelZoom.<span style="color: #0066CC;">height</span> - drag.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drag.<span style="color: #006600;">y</span>=_panelZoom.<span style="color: #006600;">y</span> + _panelZoom.<span style="color: #0066CC;">height</span> - drag.<span style="color: #0066CC;">height</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>foto.<span style="color: #006600;">x</span>&gt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foto.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>foto.<span style="color: #006600;">x</span> &lt;_fotoZoom.<span style="color: #0066CC;">width</span> - foto.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foto.<span style="color: #006600;">x</span>=_fotoZoom.<span style="color: #0066CC;">width</span> - foto.<span style="color: #0066CC;">width</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>foto.<span style="color: #006600;">y</span>&gt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foto.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>foto.<span style="color: #006600;">y</span> &lt;_fotoZoom.<span style="color: #0066CC;">height</span> - foto.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foto.<span style="color: #006600;">y</span>=_fotoZoom.<span style="color: #0066CC;">height</span> - foto.<span style="color: #0066CC;">height</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
</div>
<p></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Panel%20de%20zoom%20de%20im%C3%A1genes%20en%20Flex%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F&amp;t=Panel%20de%20zoom%20de%20im%C3%A1genes%20en%20Flex" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F&amp;title=Panel%20de%20zoom%20de%20im%C3%A1genes%20en%20Flex&amp;annotation=Este%20ejemplo%20es%2C%20igual%20que%20hice%20en%20el%20post%20anterior%2C%20un%20ejemplo%20que%20he%20adaptado%20a%20Flex%20desde%20un%20ejemplo%20que%20hice%20hace%20tiempo%20para%20Flash.%20Se%20trata%20de%20un%20panel%20donde%20se%20ve%20un%20zoom%20de%20una%20parte%20de%20una%20imagen.%0D%0A%0D%0AEste%20es%20el%20ejemplo%20montado%20en%20Flex%3A%0D%0A%0D%0A%09%0D" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F&amp;title=Panel%20de%20zoom%20de%20im%C3%A1genes%20en%20Flex&amp;notes=Este%20ejemplo%20es%2C%20igual%20que%20hice%20en%20el%20post%20anterior%2C%20un%20ejemplo%20que%20he%20adaptado%20a%20Flex%20desde%20un%20ejemplo%20que%20hice%20hace%20tiempo%20para%20Flash.%20Se%20trata%20de%20un%20panel%20donde%20se%20ve%20un%20zoom%20de%20una%20parte%20de%20una%20imagen.%0D%0A%0D%0AEste%20es%20el%20ejemplo%20montado%20en%20Flex%3A%0D%0A%0D%0A%09%0D" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Panel%20de%20zoom%20de%20im%C3%A1genes%20en%20Flex&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fpanel-de-zoom-de-imagenes-en-flex%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flex/' rel='bookmark' title='Permanent Link: Ejemplo de Zoom con lupa en Flex'>Ejemplo de Zoom con lupa en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-actionscript-3/' rel='bookmark' title='Permanent Link: Panel de zoom de imágenes en ActionScript 3'>Panel de zoom de imágenes en ActionScript 3</a></li>
<li><a href='http://www.codigoactionscript.org/drag-and-drop-en-as3/' rel='bookmark' title='Permanent Link: Drag and Drop en AS3'>Drag and Drop en AS3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ejemplo de Zoom con lupa en Flex</title>
		<link>http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flex/</link>
		<comments>http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flex/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 02:46:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[componente]]></category>
		<category><![CDATA[mascara]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=379</guid>
		<description><![CDATA[<p>Hace un tiempo escribí un ejemplo de zoom sobre una imagen con Flash. Justo ahora me acaban de preguntar como adaptar ese ejemplo a una aplicación Flex.</p>
<p>Adaptar ese ejemplo es fácil, ya que el código actionscript se puede reutilizar prácticamente igual. Lo único que hay que tener en cuenta es que no vamos a trabajar con un MovieClip con una máscara sino con componentes mxml de Flex.</p>
<p>Así es como quedará el ejemplo montado en Flex:</p>

Desplaza el mouse sobre la imagen para mover la lupa
<p></p>
<p>Esta seria nuestra aplicación Flex:</p>



&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-flex/' rel='bookmark' title='Permanent Link: Panel de zoom de imágenes en Flex'>Panel de zoom de imágenes en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flash-cs3/' rel='bookmark' title='Permanent Link: Ejemplo de Zoom con lupa en Flash CS3'>Ejemplo de Zoom con lupa en Flash CS3</a></li>
<li><a href='http://www.codigoactionscript.org/personalizar-componentes-de-flex-con-estilos-programaticos/' rel='bookmark' title='Permanent Link: Personalizar componentes de Flex con estilos programáticos'>Personalizar componentes de Flex con estilos programáticos</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hace un tiempo escribí un ejemplo de <a href="http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flash-cs3/">zoom sobre una imagen con Flash</a>. Justo ahora me acaban de preguntar como adaptar ese ejemplo a una aplicación <strong>Flex</strong>.</p>
<p>Adaptar ese ejemplo es fácil, ya que el código actionscript se puede reutilizar prácticamente igual. Lo único que hay que tener en cuenta es que no vamos a trabajar con un MovieClip con una máscara sino con componentes mxml de Flex.</p>
<p>Así es como quedará el ejemplo montado en Flex:</p>
<div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="350" height="225"><param name="movie" value="http://www.codigoactionscript.org/files/EfectoLupaFlex/EfectoLupa.swf" /><param name="quality" value="high" /><embed src="http://www.codigoactionscript.org/files/EfectoLupaFlex/EfectoLupa.swf" width="350" height="225" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object><br />
<em>Desplaza el mouse sobre la imagen para mover la lupa</em></div>
<p><br/><br/></p>
<p>Esta seria nuestra aplicación Flex:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-42">
<div class="actionscript">&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layout=<span style="color: #ff0000;">"absolute"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:ui=<span style="color: #ff0000;">"*"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; creationComplete=<span style="color: #ff0000;">"ini()"</span>&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> LupaFx;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _lupa:LupaFx;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> ini<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa=<span style="color: #000000; font-weight: bold;">new</span> LupaFx<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, foto, lupa<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&nbsp; &nbsp; &lt;mx:Image&nbsp; id=<span style="color: #ff0000;">"foto"</span> scaleContent=<span style="color: #ff0000;">"true"</span> horizontalCenter=<span style="color: #ff0000;">"0"</span> verticalCenter=<span style="color: #ff0000;">"0"</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"350"</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"250"</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:source&gt;img/Waterfall.<span style="color: #006600;">jpg</span>&lt;/mx:source&gt;<br />
&nbsp; &nbsp; &lt;/mx:Image&gt;</p>
<p>&nbsp; &nbsp; &lt;ui:Lupa id=<span style="color: #ff0000;">"lupa"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;x=<span style="color: #ff0000;">"0"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;y=<span style="color: #ff0000;">"0"</span>/&gt;</p>
<p>&lt;/mx:Application&gt;</p></div>
</div>
</div>
</div>
<p></p>
<p>El componente que utilizaremos como lupa:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-43">
<div class="actionscript">&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?&gt;<br />
&lt;mx:Canvas xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">"100"</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">"100"</span> borderStyle=<span style="color: #ff0000;">"solid"</span> borderThickness=<span style="color: #ff0000;">"4"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">"#FF0000"</span> horizontalScrollPolicy=<span style="color: #ff0000;">"off"</span> verticalScrollPolicy=<span style="color: #ff0000;">"off"</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:Image id=<span style="color: #ff0000;">"foto"</span> scaleContent=<span style="color: #ff0000;">"false"</span> y=<span style="color: #ff0000;">"0"</span> x=<span style="color: #ff0000;">"0"</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:source&gt;img/Waterfall.<span style="color: #006600;">jpg</span>&lt;/mx:source&gt;<br />
&nbsp; &nbsp; &lt;/mx:Image&gt;</p>
<p>&lt;/mx:Canvas&gt;</p></div>
</div>
</div>
</div>
<p></p>
<p>Y la clase de actionscript que controlará el efecto:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-44">
<div class="actionscript">package<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> LupaFx<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> _stage:UIComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _foto:UIComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _lupa:UIComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _distX:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _distY:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _porcentajeX:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _porcentajeY:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//----------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> LupaFx<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span>:UIComponent, foto:UIComponent, lupa:UIComponent<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _stage=<span style="color: #0066CC;">stage</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _foto=foto;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa=lupa;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span>, lupaMouseMove<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lupaMouseMove<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: #808080; font-style: italic;">//----------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> lupaMouseMove<span style="color: #66cc66;">&#40;</span>event:MouseEvent=<span style="color: #000000; font-weight: bold;">null</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; calculaDist<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mueveLupa<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">x</span>=_foto.<span style="color: #006600;">mouseX</span> + _foto.<span style="color: #006600;">x</span> - _lupa.<span style="color: #0066CC;">width</span> / <span style="color: #cc66cc;">2</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">y</span>=_foto.<span style="color: #006600;">mouseY</span> + _foto.<span style="color: #006600;">y</span> - _lupa.<span style="color: #0066CC;">height</span> / <span style="color: #cc66cc;">2</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">x</span> &lt;_foto.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">x</span>=_foto.<span style="color: #006600;">x</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">x</span>&gt; _foto.<span style="color: #006600;">x</span> + _foto.<span style="color: #0066CC;">width</span> - _lupa.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">x</span>=_foto.<span style="color: #006600;">x</span> + _foto.<span style="color: #0066CC;">width</span> - _lupa.<span style="color: #0066CC;">width</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">y</span> &lt;_foto.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">y</span>=_foto.<span style="color: #006600;">y</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">y</span>&gt; _foto.<span style="color: #006600;">y</span> + _foto.<span style="color: #0066CC;">height</span> - _lupa.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">y</span>=_foto.<span style="color: #006600;">y</span> + _foto.<span style="color: #0066CC;">height</span> - _lupa.<span style="color: #0066CC;">height</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//----------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> calculaDist<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; _porcentajeX=<span style="color: #cc66cc;">100</span> / <span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">width</span> / <span style="color: #66cc66;">&#40;</span>_foto.<span style="color: #0066CC;">width</span> - _lupa.<span style="color: #0066CC;">width</span> / <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _porcentajeY=<span style="color: #cc66cc;">100</span> / <span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">height</span> / <span style="color: #66cc66;">&#40;</span>_foto.<span style="color: #0066CC;">height</span> - _lupa.<span style="color: #0066CC;">height</span> / <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _distX=<span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">x</span> - _foto.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span> / _porcentajeX * <span style="color: #cc66cc;">100</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _distY=<span style="color: #66cc66;">&#40;</span>_lupa.<span style="color: #006600;">y</span> - _foto.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span> / _porcentajeY * <span style="color: #cc66cc;">100</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//----------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> mueveLupa<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; _lupa.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">x</span>=-_distX;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _lupa.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">y</span>=-_distY;<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>
</div>
<p></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Ejemplo%20de%20Zoom%20con%20lupa%20en%20Flex%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F&amp;t=Ejemplo%20de%20Zoom%20con%20lupa%20en%20Flex" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F&amp;title=Ejemplo%20de%20Zoom%20con%20lupa%20en%20Flex&amp;annotation=Hace%20un%20tiempo%20escrib%C3%AD%20un%20ejemplo%20de%20zoom%20sobre%20una%20imagen%20con%20Flash.%20Justo%20ahora%20me%20acaban%20de%20preguntar%20como%20adaptar%20ese%20ejemplo%20a%20una%20aplicaci%C3%B3n%20Flex.%0D%0A%0D%0AAdaptar%20ese%20ejemplo%20es%20f%C3%A1cil%2C%20ya%20que%20el%20c%C3%B3digo%20actionscript%20se%20puede%20reutilizar%20pr%C3%A1cticam" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F&amp;title=Ejemplo%20de%20Zoom%20con%20lupa%20en%20Flex&amp;notes=Hace%20un%20tiempo%20escrib%C3%AD%20un%20ejemplo%20de%20zoom%20sobre%20una%20imagen%20con%20Flash.%20Justo%20ahora%20me%20acaban%20de%20preguntar%20como%20adaptar%20ese%20ejemplo%20a%20una%20aplicaci%C3%B3n%20Flex.%0D%0A%0D%0AAdaptar%20ese%20ejemplo%20es%20f%C3%A1cil%2C%20ya%20que%20el%20c%C3%B3digo%20actionscript%20se%20puede%20reutilizar%20pr%C3%A1cticam" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Ejemplo%20de%20Zoom%20con%20lupa%20en%20Flex&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fejemplo-de-zoom-con-lupa-en-flex%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/panel-de-zoom-de-imagenes-en-flex/' rel='bookmark' title='Permanent Link: Panel de zoom de imágenes en Flex'>Panel de zoom de imágenes en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flash-cs3/' rel='bookmark' title='Permanent Link: Ejemplo de Zoom con lupa en Flash CS3'>Ejemplo de Zoom con lupa en Flash CS3</a></li>
<li><a href='http://www.codigoactionscript.org/personalizar-componentes-de-flex-con-estilos-programaticos/' rel='bookmark' title='Permanent Link: Personalizar componentes de Flex con estilos programáticos'>Personalizar componentes de Flex con estilos programáticos</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/ejemplo-de-zoom-con-lupa-en-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Acceder a los itemRenderer de un componente lista en Flex</title>
		<link>http://www.codigoactionscript.org/acceder-a-los-itemrenderer-de-un-componente-lista-en-flex/</link>
		<comments>http://www.codigoactionscript.org/acceder-a-los-itemrenderer-de-un-componente-lista-en-flex/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 03:45:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[componente]]></category>
		<category><![CDATA[DataProvider]]></category>
		<category><![CDATA[itemRenderer]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=361</guid>
		<description><![CDATA[<p>Este es un tip sencillo pero que me dió algún que otro dolor de cabeza al querer aplicar unos efectos sobre los componentes utilizados como itemRenderes dentro de un componente tipo lista en Flex. Se trata de cómo poder acceder a estos componentes para manipular su contenido a través de Actionscript.</p>
<p>Para acceder al componente del itemRenderer en concreto utilizaremos indexToItemRenderer, pasándole como parámetro el index del ítem que queremos obtener.</p>
<p>El detalle importante que debemos tener en cuenta es que no podemos referenciar un objeto que no sea visible dentro de [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/asignar-una-clase-actionscript-3-a-un-itemrenderer-en-flex/' rel='bookmark' title='Permanent Link: Asignar una clase ActionScript 3 a un itemRenderer en Flex'>Asignar una clase ActionScript 3 a un itemRenderer en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/cargar-xml-en-un-componente-list-en-actionscript-3/' rel='bookmark' title='Permanent Link: Cargar XML en un componente List en Actionscript 3'>Cargar XML en un componente List en Actionscript 3</a></li>
<li><a href='http://www.codigoactionscript.org/error-de-seleccion-de-color-en-el-componente-richtexteditor-de-flex/' rel='bookmark' title='Permanent Link: Error de selección de color en el componente RichTextEditor de Flex'>Error de selección de color en el componente RichTextEditor de Flex</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Este es un <a href="http://www.cristalab.com/tip">tip</a> sencillo pero que me dió algún que otro dolor de cabeza al querer aplicar unos efectos sobre los componentes utilizados como <strong>itemRenderes </strong>dentro de un componente tipo lista en <a href="http://www.cristalab.com/tips/tags/flex">Flex</a>. Se trata de cómo poder acceder a estos componentes para manipular su contenido a través de <a href="http://www.cristalab.com/tips/tags/actionscript_3">Actionscript</a>.</p>
<p>Para acceder al componente del itemRenderer en concreto utilizaremos <strong>indexToItemRenderer</strong>, pasándole como parámetro el index del ítem que queremos obtener.</p>
<p>El detalle importante que debemos tener en cuenta es que no podemos referenciar un objeto que no sea visible dentro de la zona del scroll, ya que hasta entonces devolvería valor <em>null</em>. Para ello deveremos realizar la comprobación con <strong>isItemVisible</strong>, y ejecutar las acciones solo sobre los componentes visibles.</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-47">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> total:uint = tileList.<span style="color: #006600;">dataProvider</span>.<span style="color: #0066CC;">length</span>;<br />
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:uint = <span style="color: #cc66cc;">0</span>; i &lt;total; i++<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>tileList.<span style="color: #006600;">isItemVisible</span><span style="color: #66cc66;">&#40;</span>tileList.<span style="color: #006600;">dataProvider</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> item:<span style="color: #0066CC;">Object</span> = tileList.<span style="color: #006600;">indexToItemRenderer</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// resto de implementación sobre los componentes</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
</div>
<p></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Acceder%20a%20los%20itemRenderer%20de%20un%20componente%20lista%20en%20Flex%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F&amp;t=Acceder%20a%20los%20itemRenderer%20de%20un%20componente%20lista%20en%20Flex" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F&amp;title=Acceder%20a%20los%20itemRenderer%20de%20un%20componente%20lista%20en%20Flex&amp;annotation=Este%20es%20un%20%20sencillo%20pero%20que%20me%20di%C3%B3%20alg%C3%BAn%20que%20otro%20dolor%20de%20cabeza%20al%20querer%20aplicar%20unos%20efectos%20sobre%20los%20componentes%20utilizados%20como%20dentro%20de%20un%20componente%20tipo%20lista%20en%20.%20Se%20trata%20de%20c%C3%B3mo%20poder%20acceder%20a%20estos%20componentes%20para%20manipular%20su%20c" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F&amp;title=Acceder%20a%20los%20itemRenderer%20de%20un%20componente%20lista%20en%20Flex&amp;notes=Este%20es%20un%20%20sencillo%20pero%20que%20me%20di%C3%B3%20alg%C3%BAn%20que%20otro%20dolor%20de%20cabeza%20al%20querer%20aplicar%20unos%20efectos%20sobre%20los%20componentes%20utilizados%20como%20dentro%20de%20un%20componente%20tipo%20lista%20en%20.%20Se%20trata%20de%20c%C3%B3mo%20poder%20acceder%20a%20estos%20componentes%20para%20manipular%20su%20c" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Acceder%20a%20los%20itemRenderer%20de%20un%20componente%20lista%20en%20Flex&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Facceder-a-los-itemrenderer-de-un-componente-lista-en-flex%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/asignar-una-clase-actionscript-3-a-un-itemrenderer-en-flex/' rel='bookmark' title='Permanent Link: Asignar una clase ActionScript 3 a un itemRenderer en Flex'>Asignar una clase ActionScript 3 a un itemRenderer en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/cargar-xml-en-un-componente-list-en-actionscript-3/' rel='bookmark' title='Permanent Link: Cargar XML en un componente List en Actionscript 3'>Cargar XML en un componente List en Actionscript 3</a></li>
<li><a href='http://www.codigoactionscript.org/error-de-seleccion-de-color-en-el-componente-richtexteditor-de-flex/' rel='bookmark' title='Permanent Link: Error de selección de color en el componente RichTextEditor de Flex'>Error de selección de color en el componente RichTextEditor de Flex</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/acceder-a-los-itemrenderer-de-un-componente-lista-en-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mostrar una alerta antes del cierre de una aplicación AIR</title>
		<link>http://www.codigoactionscript.org/mostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air/</link>
		<comments>http://www.codigoactionscript.org/mostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 01:59:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[componente]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=322</guid>
		<description><![CDATA[<p>En este ejemplo mostraré como crear una ventana de alerta cuando le demos al botón de cerrar en una aplicación AIR, teniendo que validar el cierre evitando que se cierre directamente. De esta manera podemos controlar que el usuario cierre la aplicación si haber realizado una operación necesaria, por ejemplo guardar los cambios realizados en el caso de tratarse de una a aplicación que edite documentos.</p>

<p>Lo primero que deberemos hacer es colocar la función a realizar cuando se detecte el evento de cierre de la aplicación (osea, cuando el usuario [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/como-personalizar-el-icono-del-panel-de-alerta-de-flex/' rel='bookmark' title='Permanent Link: Cómo personalizar el icono del panel de Alerta de Flex'>Cómo personalizar el icono del panel de Alerta de Flex</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>En este ejemplo mostraré como crear una ventana de alerta cuando le demos al botón de cerrar en una aplicación AIR, teniendo que validar el cierre evitando que se cierre directamente. De esta manera podemos controlar que el usuario cierre la aplicación si haber realizado una operación necesaria, por ejemplo guardar los cambios realizados en el caso de tratarse de una a aplicación que edite documentos.</p>
<div align="center"><img src="http://www.cristalab.com/images/tips/flex/cerrarAlert/cap_005.png" alt="" /></div>
<p>Lo primero que deberemos hacer es colocar la función a realizar cuando se detecte el evento de cierre de la aplicación (osea, cuando el usuario cierra la aplicación).</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-54">
<div class="actionscript">&lt;mx:WindowedApplication xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> layout=<span style="color: #ff0000;">"absolute"</span> closing=<span style="color: #ff0000;">"cerrarApp(event)"</span>&gt;</div>
</div>
</div>
</div>
<p></p>
<p>Ahora escribiremos la función. El punto importante aquí es como evitar el cierre de la aplicación, ya que el usuario realmente a clicado en el botón de cerrar. Esto lo conseguimos con el método <strong>preventDefault()</strong> de la clase Event. Con este método conseguimos que el evento no ejecute las funciones por defecto y por lo tanto no se cierra la aplicación. Lo que haremos en su lugar es abrir una ventana de <strong>Alert</strong>.</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-55">
<div class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> cerrarApp<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<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;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Alert.<span style="color: #006600;">yesLabel</span> = <span style="color: #ff0000;">"Si"</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"¿Realmente quiere salir?"</span>,<span style="color: #ff0000;">"Salir aplicación"</span>, Alert.<span style="color: #006600;">YES</span> | Alert.<span style="color: #006600;">NO</span>, <span style="color: #000000; font-weight: bold;">null</span>, cerrar, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
</div>
<p></p>
<div align="center"><img src="http://www.cristalab.com/images/tips/flex/cerrarAlert/cap_007.png" alt="" /></div>
<p>Con <strong>yesLabel  </strong>decimos que aparezca el texto "Si" en el botón de validar en lugar de "Yes". Y con el <strong>2</strong> al final de los parámetros decimos que el botón seleccionado por defecto sea el segundo, osea el "No".</p>
<p>También le estamos indicando que al clicar sobre cualquiera de los botones se ejecute la función "<strong>cerrar</strong>" que es la siguiente:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-56">
<div class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cerrar<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:CloseEvent<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><span style="color: #0066CC;">e</span>.<span style="color: #006600;">detail</span> == Alert.<span style="color: #006600;">YES</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">nativeApplication</span>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</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>
</div>
<p></p>
<p>Donde le estamos indicando que si el botón seleccionado es el "Si" entonces cierre la aplicación. En el caso de seleccionar el "No" no se ejecuta nada y por lo tanto la aplicación sigue abierta.</p>
<p>[h3]Segundo ejemplo[/h3]</p>
<p>El código anterior se ejecutaría siempre que le demos al icono de cerrar aplicación. Pero lo interesante es poder controlar cuando queremos mostrar esa advertencia. </p>
<p>Por ejemplo en el caso de tener una aplicación que sea un editor de texto. Si le damos al botón de cerrar la aplicación teniendo cambios sin guardar mostraremos el Alert, pero en el caso de haber guardado los cambios previamente cerraremos directamente la aplicación.</p>
<p>Primero crearemos una variable booleana que controlará si la aplicación se cierra automáticamente o requiere mostrar la advertencia.</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-57">
<div class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> cierre:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</div>
</div>
</div>
<p></p>
<p>En la función que se ejecuta al cerrar la aplicación colocaremos un condicional que detecte el estado de esa variable. </p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-58">
<div class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cerrarApp<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<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;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>cierre == <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Alert.<span style="color: #006600;">yesLabel</span> = <span style="color: #ff0000;">"Si"</span>;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"¿Desea guardar los cambios antes de salir?"</span>,<span style="color: #ff0000;">"Salir aplicación"</span>, Alert.<span style="color: #006600;">YES</span> | Alert.<span style="color: #006600;">NO</span> | Alert.<span style="color: #006600;">CANCEL</span>, <span style="color: #000000; font-weight: bold;">null</span>, cerrar, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">nativeApplication</span>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</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>
</div>
<p></p>
<div align="center"><img src="http://www.cristalab.com/images/tips/flex/cerrarAlert/cap_009.png" alt="" /></div>
<p>Lógicamente esa función "<strong>cierre</strong>" la deberemos controlar con el resto de funciones de la aplicación. Es decir, todas las funciones que realicen <strong>cualquier cambio que deba ser guardado</strong> deberán colocar esa variable a "<strong>false</strong>", y la función que realice el <strong>guardado de datos</strong> deberá colocar la variable a "<strong>true</strong>".</p>
<p>La función de cierre quedaría asi:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-59">
<div class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cerrar<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:CloseEvent<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><span style="color: #0066CC;">e</span>.<span style="color: #006600;">detail</span> == Alert.<span style="color: #006600;">YES</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; guardarDatos<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">nativeApplication</span>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">detail</span> == Alert.<span style="color: #006600;">NO</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">nativeApplication</span>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</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>
</div>
<p></p>
<p>De manera que si clicamos "Si" ejecutaríamos la función que nos guarda los datos y cerraríamos después la aplicación, si clisásemos "No" cerraríamos directamente y si clisásemos "Cancel" entonces no se ejecutaría nada y no cerraríamos la aplicación.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Mostrar%20una%20alerta%20antes%20del%20cierre%20de%20una%20aplicaci%C3%B3n%20AIR%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F&amp;t=Mostrar%20una%20alerta%20antes%20del%20cierre%20de%20una%20aplicaci%C3%B3n%20AIR" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F&amp;title=Mostrar%20una%20alerta%20antes%20del%20cierre%20de%20una%20aplicaci%C3%B3n%20AIR&amp;annotation=En%20este%20ejemplo%20mostrar%C3%A9%20como%20crear%20una%20ventana%20de%20alerta%20cuando%20le%20demos%20al%20bot%C3%B3n%20de%20cerrar%20en%20una%20aplicaci%C3%B3n%20AIR%2C%20teniendo%20que%20validar%20el%20cierre%20evitando%20que%20se%20cierre%20directamente.%20De%20esta%20manera%20podemos%20controlar%20que%20el%20usuario%20cierre%20la%20aplic" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F&amp;title=Mostrar%20una%20alerta%20antes%20del%20cierre%20de%20una%20aplicaci%C3%B3n%20AIR&amp;notes=En%20este%20ejemplo%20mostrar%C3%A9%20como%20crear%20una%20ventana%20de%20alerta%20cuando%20le%20demos%20al%20bot%C3%B3n%20de%20cerrar%20en%20una%20aplicaci%C3%B3n%20AIR%2C%20teniendo%20que%20validar%20el%20cierre%20evitando%20que%20se%20cierre%20directamente.%20De%20esta%20manera%20podemos%20controlar%20que%20el%20usuario%20cierre%20la%20aplic" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Mostrar%20una%20alerta%20antes%20del%20cierre%20de%20una%20aplicaci%C3%B3n%20AIR&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fmostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/como-personalizar-el-icono-del-panel-de-alerta-de-flex/' rel='bookmark' title='Permanent Link: Cómo personalizar el icono del panel de Alerta de Flex'>Cómo personalizar el icono del panel de Alerta de Flex</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/mostrar-una-alerta-antes-del-cierre-de-una-aplicacion-air/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ordenar elementos de un Vector en Actionscript 3</title>
		<link>http://www.codigoactionscript.org/como-ordenar-elementos-de-un-vector-en-actionscript-3/</link>
		<comments>http://www.codigoactionscript.org/como-ordenar-elementos-de-un-vector-en-actionscript-3/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 16:54:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Avanzado]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Noticias]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=310</guid>
		<description><![CDATA[<p>En este ejemplo explicaré como ordenar elementos internos de un objeto de clase Vector en Actionscript 3. Para ordenar los elementos en realidad se realiza de igual manera que en un Array. Únicamente deberemos escribir una función que compare lo elementos según el orden que nos interese.</p>
<p>El valor que nos ha de devolver la función que realiza la comparación deberá ser:</p>

1: Si el primer valor es superior al segundo
-1: si el primer valor es inferior al segundo
0: Si los valores son iguales

<p>De manera que si creamos un Vector con 10 [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/ordenar-los-elementos-de-un-arraycollection-en-flex/' rel='bookmark' title='Permanent Link: Ordenar los elementos de un ArrayCollection en Flex'>Ordenar los elementos de un ArrayCollection en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/anadir-funciones-al-teclado-con-actionscript-3/' rel='bookmark' title='Permanent Link: Añadir funciones al teclado con Actionscript 3'>Añadir funciones al teclado con Actionscript 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>En este ejemplo explicaré como ordenar elementos internos de un objeto de clase Vector en Actionscript 3. Para ordenar los elementos en realidad se realiza de igual manera que en un Array. Únicamente deberemos escribir una función que compare lo elementos según el orden que nos interese.</p>
<p>El valor que nos ha de devolver la función que realiza la comparación deberá ser:</p>
<ul>
<li>1: Si el primer valor es superior al segundo</li>
<li>-1: si el primer valor es inferior al segundo</li>
<li>0: Si los valores son iguales</li>
</ul>
<p>De manera que si creamos un Vector con 10 numero aleatorios:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-66">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> vector:Vector.&lt;uint&gt; = <span style="color: #000000; font-weight: bold;">new</span> Vector.&lt;uint&gt;<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i &lt;<span style="color: #cc66cc;">10</span>; i++<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; vector.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> * <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>vector<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//25,19,69,95,57,78,59,86,2,97 </span></div>
</div>
</div>
</div>
<p></p>
<p>Si ahora lo quisiésemos ordenar de forma ascendente haríamos lo siguiente:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-67">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> ascendente<span style="color: #66cc66;">&#40;</span>x:uint, y:uint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>x&gt;= y<span style="color: #66cc66;">&#41;</span>?<span style="color: #cc66cc;">1</span> :-<span style="color: #cc66cc;">1</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
vector.<span style="color: #0066CC;">sort</span><span style="color: #66cc66;">&#40;</span>ascendente<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>vector<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//2,19,25,57,59,69,78,86,95,97 </span></div>
</div>
</div>
</div>
<p></p>
<p>Y lo mismo para ordenarlo de forma descendente:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-68">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> descendente<span style="color: #66cc66;">&#40;</span>x:uint, y:uint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>x &lt;y<span style="color: #66cc66;">&#41;</span>?<span style="color: #cc66cc;">1</span> :-<span style="color: #cc66cc;">1</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
vector.<span style="color: #0066CC;">sort</span><span style="color: #66cc66;">&#40;</span>descendente<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>vector<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//97,95,86,78,69,59,57,25,19,2 </span></div>
</div>
</div>
</div>
<p></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Ordenar%20elementos%20de%20un%20Vector%20en%20Actionscript%203%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F&amp;t=Ordenar%20elementos%20de%20un%20Vector%20en%20Actionscript%203" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F&amp;title=Ordenar%20elementos%20de%20un%20Vector%20en%20Actionscript%203&amp;annotation=En%20este%20ejemplo%20explicar%C3%A9%20como%20ordenar%20elementos%20internos%20de%20un%20objeto%20de%20clase%20Vector%20en%20Actionscript%203.%20Para%20ordenar%20los%20elementos%20en%20realidad%20se%20realiza%20de%20igual%20manera%20que%20en%20un%20Array.%20%C3%9Anicamente%20deberemos%20escribir%20una%20funci%C3%B3n%20que%20compare%20lo%20e" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F&amp;title=Ordenar%20elementos%20de%20un%20Vector%20en%20Actionscript%203&amp;notes=En%20este%20ejemplo%20explicar%C3%A9%20como%20ordenar%20elementos%20internos%20de%20un%20objeto%20de%20clase%20Vector%20en%20Actionscript%203.%20Para%20ordenar%20los%20elementos%20en%20realidad%20se%20realiza%20de%20igual%20manera%20que%20en%20un%20Array.%20%C3%9Anicamente%20deberemos%20escribir%20una%20funci%C3%B3n%20que%20compare%20lo%20e" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Ordenar%20elementos%20de%20un%20Vector%20en%20Actionscript%203&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fcomo-ordenar-elementos-de-un-vector-en-actionscript-3%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/ordenar-los-elementos-de-un-arraycollection-en-flex/' rel='bookmark' title='Permanent Link: Ordenar los elementos de un ArrayCollection en Flex'>Ordenar los elementos de un ArrayCollection en Flex</a></li>
<li><a href='http://www.codigoactionscript.org/anadir-funciones-al-teclado-con-actionscript-3/' rel='bookmark' title='Permanent Link: Añadir funciones al teclado con Actionscript 3'>Añadir funciones al teclado con Actionscript 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/como-ordenar-elementos-de-un-vector-en-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Otener parámetros en eventos de Actionscript 3</title>
		<link>http://www.codigoactionscript.org/otener-parametros-en-eventos-de-actionscript-3/</link>
		<comments>http://www.codigoactionscript.org/otener-parametros-en-eventos-de-actionscript-3/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 22:03:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Trucos]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[eventos]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[mouse]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=252</guid>
		<description><![CDATA[<p>Cuando lanzamos un evento en Actionscript 3, por ejemplo de la clase MouseEvent, ponemos recuperar una serie de parámetros lanzados con ese evento.</p>
<p>Por ejemplo, en este código:</p>



boton.addEventListener&#40;MouseEvent.MOUSE_DOWN, onBotonEvent&#41;;</p>
<p>function onBotonEvent&#40;e:MouseEvent&#41;:void
&#123;
&#160; &#160; trace&#40;e&#41;;
&#125;



<p></p>
<p>El trace() nos mostraría el evento que ha lanzado la función mostrando también todos los parámetros. En este caso serían estos:</p>



MouseEvent type="mouseDown" bubbles=true cancelable=false eventPhase=2 localX=43 localY=30 stageX=170.55 stageY=106 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0



<p></p>
<p>Recuperar estos parámetros y saber con detalle el evento que ha lanzado la función nos puede resultar muy útil en muchos casos.</p>
<p>por ejemplo, su quisiésemos ejecutar una [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/eventos-de-boton-en-as3/' rel='bookmark' title='Permanent Link: Eventos de botón en AS3'>Eventos de botón en AS3</a></li>
<li><a href='http://www.codigoactionscript.org/eventos-click-y-doble-click-en-un-boton-con-actionscript-3/' rel='bookmark' title='Permanent Link: Eventos click y doble click en un botón con Actionscript 3'>Eventos click y doble click en un botón con Actionscript 3</a></li>
<li><a href='http://www.codigoactionscript.org/botones-con-parametros-en-actionscript-3/' rel='bookmark' title='Permanent Link: Botones con parámetros en Actionscript 3'>Botones con parámetros en Actionscript 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Cuando lanzamos un evento en <a href="http://www.cristalab.com/tips/tags/actionscript_3">Actionscript 3</a>, por ejemplo de la clase <strong>MouseEvent</strong>, ponemos recuperar una serie de parámetros lanzados con ese evento.</p>
<p>Por ejemplo, en este código:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-77">
<div class="actionscript">boton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, onBotonEvent<span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #000000; font-weight: bold;">function</span> onBotonEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<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: #0066CC;">e</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
</div>
<p></p>
<p>El <strong>trace()</strong> nos mostraría el evento que ha lanzado la función mostrando también todos los parámetros. En este caso serían estos:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-78">
<div class="actionscript">MouseEvent <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">"mouseDown"</span> bubbles=<span style="color: #000000; font-weight: bold;">true</span> cancelable=<span style="color: #000000; font-weight: bold;">false</span> eventPhase=<span style="color: #cc66cc;">2</span> localX=<span style="color: #cc66cc;">43</span> localY=<span style="color: #cc66cc;">30</span> stageX=<span style="color: #cc66cc;">170</span>.<span style="color: #cc66cc;">55</span> stageY=<span style="color: #cc66cc;">106</span> relatedObject=<span style="color: #000000; font-weight: bold;">null</span> ctrlKey=<span style="color: #000000; font-weight: bold;">false</span> altKey=<span style="color: #000000; font-weight: bold;">false</span> shiftKey=<span style="color: #000000; font-weight: bold;">false</span> delta=<span style="color: #cc66cc;">0</span></div>
</div>
</div>
</div>
<p></p>
<p>Recuperar estos parámetros y saber con detalle el evento que ha lanzado la función nos puede resultar muy útil en muchos casos.</p>
<p>por ejemplo, su quisiésemos ejecutar una acción u otra al clicar sobre el botón dependiendo si estamos pulsando la tecla <strong><ctrl></strong> podríamos recuperar ese parámetro del evento:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-79">
<div class="actionscript">boton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, onBotonEvent<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">function</span> onBotonEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<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;">e</span>.<span style="color: #006600;">ctrlKey</span> == <span style="color: #000000; font-weight: bold;">true</span> ? accion1<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : accion2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
</div>
<p></p>
<p>Aquí, si clicamos al botón sin tener pulsada la tecla <strong><ctrl></strong> ejecutaremos la función <strong>accion2</strong>, mientras que con el mismo clic con la tecla pulsada ejecutaríamos la función <strong>accion1</strong>.</p>
<p>También podemos utilizar este recurso para asignar la misma función a varios eventos y poder asignar diferentes parámetros a la función dependiendo del tipo de evento:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-80">
<div class="actionscript"><span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">motion</span>.<span style="color: #0066CC;">Color</span>;<br />
boton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">ROLL_OVER</span>, onBotonEvent<span style="color: #66cc66;">&#41;</span>;<br />
boton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">ROLL_OUT</span>, onBotonEvent<span style="color: #66cc66;">&#41;</span>;<br />
boton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, onBotonEvent<span style="color: #66cc66;">&#41;</span>;<br />
boton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, onBotonEvent<span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #000000; font-weight: bold;">function</span> onBotonEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> code:uint;&nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">type</span> == <span style="color: #ff0000;">"rollOver"</span> ? code = 0xCCCCCC : <span style="color: #000000; font-weight: bold;">null</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">type</span> == <span style="color: #ff0000;">"rollOut"</span> ? code = 0x999999 : <span style="color: #000000; font-weight: bold;">null</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">type</span> == <span style="color: #ff0000;">"mouseDown"</span> ? code = 0x666666 : <span style="color: #000000; font-weight: bold;">null</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">type</span> == <span style="color: #ff0000;">"mouseUp"</span> ? code = 0xCCCCCC : <span style="color: #000000; font-weight: bold;">null</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">color</span>:<span style="color: #0066CC;">Color</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Color</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">color</span>.<span style="color: #006600;">setTint</span><span style="color: #66cc66;">&#40;</span>code, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">transform</span>.<span style="color: #006600;">colorTransform</span> = <span style="color: #0066CC;">color</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
</div>
<p></p>
<p>En este ejemplo, todos los eventos del botón ejecutan la misma función pero dependiendo de cada uno se coloreará el clip de un color u otro.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Otener%20par%C3%A1metros%20en%20eventos%20de%20Actionscript%203%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F&amp;t=Otener%20par%C3%A1metros%20en%20eventos%20de%20Actionscript%203" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F&amp;title=Otener%20par%C3%A1metros%20en%20eventos%20de%20Actionscript%203&amp;annotation=Cuando%20lanzamos%20un%20evento%20en%20%2C%20por%20ejemplo%20de%20la%20clase%20%2C%20ponemos%20recuperar%20una%20serie%20de%20par%C3%A1metros%20lanzados%20con%20ese%20evento.%0D%0A%0D%0APor%20ejemplo%2C%20en%20este%20c%C3%B3digo%3A%0D%0A%0D%0A%5Bas%5D%0D%0Aboton.addEventListener%28MouseEvent.MOUSE_DOWN%2C%20onBotonEvent%29%3B%0D%0A%0D%0Afunction%20onBotonEve" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F&amp;title=Otener%20par%C3%A1metros%20en%20eventos%20de%20Actionscript%203&amp;notes=Cuando%20lanzamos%20un%20evento%20en%20%2C%20por%20ejemplo%20de%20la%20clase%20%2C%20ponemos%20recuperar%20una%20serie%20de%20par%C3%A1metros%20lanzados%20con%20ese%20evento.%0D%0A%0D%0APor%20ejemplo%2C%20en%20este%20c%C3%B3digo%3A%0D%0A%0D%0A%5Bas%5D%0D%0Aboton.addEventListener%28MouseEvent.MOUSE_DOWN%2C%20onBotonEvent%29%3B%0D%0A%0D%0Afunction%20onBotonEve" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Otener%20par%C3%A1metros%20en%20eventos%20de%20Actionscript%203&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Fotener-parametros-en-eventos-de-actionscript-3%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/eventos-de-boton-en-as3/' rel='bookmark' title='Permanent Link: Eventos de botón en AS3'>Eventos de botón en AS3</a></li>
<li><a href='http://www.codigoactionscript.org/eventos-click-y-doble-click-en-un-boton-con-actionscript-3/' rel='bookmark' title='Permanent Link: Eventos click y doble click en un botón con Actionscript 3'>Eventos click y doble click en un botón con Actionscript 3</a></li>
<li><a href='http://www.codigoactionscript.org/botones-con-parametros-en-actionscript-3/' rel='bookmark' title='Permanent Link: Botones con parámetros en Actionscript 3'>Botones con parámetros en Actionscript 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/otener-parametros-en-eventos-de-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Listar archivos de un directorio web con PHP y XML</title>
		<link>http://www.codigoactionscript.org/listar-archivos-de-un-directorio-web-con-php-y-xml/</link>
		<comments>http://www.codigoactionscript.org/listar-archivos-de-un-directorio-web-con-php-y-xml/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 15:37:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Básico]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.codigoactionscript.org/?p=221</guid>
		<description><![CDATA[<p>Este es un sencillo script de PHP que nos permite generar un archivo XML con el listado de todos los archivos y carpetas que esten contenidos dentro del directorio en el que hemos situado el archivo PHP.</p>
<p>Esto nos puede resultar útil para realizar galerías fotográficas en las que queremos acceder a todas las imágenes de un directorio y queremos poder subir o borrar archivos. El archivo XML siempre estará actualizado a los ficheros del servidor.</p>
<p>El archivo PHP es el siguiente. Lo llamaremos list.php y lo subiremos al servidor dentro de [...]


Related posts:<ol><li><a href='http://www.codigoactionscript.org/impedir-la-visualizacion-de-archivos-swf-individualmente/' rel='bookmark' title='Permanent Link: Impedir la visualización de archivos SWF individualmente'>Impedir la visualización de archivos SWF individualmente</a></li>
<li><a href='http://www.codigoactionscript.org/adm-aplicacion-air-para-editar-archivos-de-configuracion/' rel='bookmark' title='Permanent Link: ADM, aplicación AIR para editar archivos de configuración'>ADM, aplicación AIR para editar archivos de configuración</a></li>
<li><a href='http://www.codigoactionscript.org/cargar-xml-en-un-componente-list-en-actionscript-3/' rel='bookmark' title='Permanent Link: Cargar XML en un componente List en Actionscript 3'>Cargar XML en un componente List en Actionscript 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Este es un sencillo script de <a href="http://www.cristalab.com/tips/tags/php">PHP</a> que nos permite generar un archivo XML con el listado de todos los archivos y carpetas que esten contenidos dentro del directorio en el que hemos situado el archivo PHP.</p>
<p>Esto nos puede resultar útil para realizar galerías fotográficas en las que queremos acceder a todas las imágenes de un directorio y queremos poder subir o borrar archivos. El archivo XML siempre estará actualizado a los ficheros del servidor.</p>
<p>El archivo PHP es el siguiente. Lo llamaremos <strong>list.php</strong> y lo subiremos al servidor dentro de la carpeta que nos interese listar.</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="actionscript-87">
<div class="actionscript">&lt;?php<br />
&nbsp; &nbsp; $dir = <span style="color: #ff0000;">"./"</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; echo <span style="color: #ff0000;">"&lt;XML encoding='UTF-8' standalone='yes' version='1.0'&gt;<span style="color: #000099; font-weight: bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; echo <span style="color: #ff0000;">"&nbsp; &lt;folder&gt;<span style="color: #000099; font-weight: bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>is_dir<span style="color: #66cc66;">&#40;</span>$dir<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>$gd = opendir<span style="color: #66cc66;">&#40;</span>$dir<span style="color: #66cc66;">&#41;</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; &nbsp;<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>$archivo = readdir<span style="color: #66cc66;">&#40;</span>$gd<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> !== <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>$archivo != <span style="color: #ff0000;">"."</span> &amp; $archivo != <span style="color: #ff0000;">".."</span> &amp; $archivo != <span style="color: #ff0000;">"list.php"</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>is_dir<span style="color: #66cc66;">&#40;</span>$archivo<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; echo <span style="color: #ff0000;">"&nbsp; &nbsp; &lt;folder&gt;$archivo&lt;/folder&gt;<span style="color: #000099; font-weight: bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; echo <span style="color: #ff0000;">"&nbsp; &nbsp; &lt;file&gt;$archivo&lt;/file&gt;<span style="color: #000099; font-weight: bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;closedir<span style="color: #66cc66;">&#40;</span>$gd<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; echo <span style="color: #ff0000;">"&nbsp; &lt;/folder&gt;<span style="color: #000099; font-weight: bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; echo <span style="color: #ff0000;">"&lt;/XML&gt;<span style="color: #000099; font-weight: bold;">\n</span>"</span>;<br />
?&gt;</div>
</div>
</div>
</div>
<p>
El script lo único que hace es recorrer todos los elementos de la carpeta en la que está situado y a base de "echos" formatea el XML.</p>
<p>Si visualizamos este archivo desde el navegador y miramos el código resultante este sería un archivo XML de este estilo:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="code-88">
<div class="code">&lt;XML encoding=<span style="color:#CC0000;">'UTF-8'</span> standalone=<span style="color:#CC0000;">'yes'</span> version=<span style="color:#CC0000;">'1.0'</span>&gt;<br />
&nbsp; &lt;folder&gt;<br />
&nbsp; &nbsp; &lt;file&gt;img_001.<span style="">jpg</span>&lt;/file&gt;<br />
&nbsp; &nbsp; &lt;file&gt;img_002.<span style="">jpg</span>&lt;/file&gt;<br />
&nbsp; &nbsp; &lt;file&gt;img_003.<span style="">jpg</span>&lt;/file&gt;<br />
&nbsp; &nbsp; &lt;file&gt;img_004.<span style="">jpg</span>&lt;/file&gt;<br />
&nbsp; &nbsp; &lt;file&gt;img_005.<span style="">jpg</span>&lt;/file&gt;<br />
&nbsp; &nbsp; &lt;folder&gt;thumbs&lt;/folder&gt;<br />
&nbsp; &nbsp; &lt;folder&gt;hires&lt;/folder&gt;<br />
&nbsp; &lt;/folder&gt;<br />
&lt;/XML&gt;</div>
</div>
</div>
</div>
<p></p>
<p>De esta manera si quisiésemos, por ejemplo, listar el contenido de imágenes disponibles de este directorio dentro de un componente List de Flash haríamos lo siguiente:</p>
<div id="codigo">
<div class="syntax_hilite">
<div id="code-89">
<div class="code">import fl.<span style="">data</span>.<span style="">DataProvider</span>;</p>
<p>var _URLLoader = new URLLoader<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
var _URLRequest = new URLRequest<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>_URLRequest.<span style="">url</span> = <span style="color:#CC0000;">"/img/list.php"</span>;<br />
_URLLoader.<span style="">load</span><span style="color:#006600; font-weight:bold;">&#40;</span>_URLRequest<span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
_URLLoader.<span style="">addEventListener</span><span style="color:#006600; font-weight:bold;">&#40;</span>Event.<span style="">COMPLETE</span>, onListComplete<span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>function onListComplete<span style="color:#006600; font-weight:bold;">&#40;</span>e:Event<span style="color:#006600; font-weight:bold;">&#41;</span>:void<br />
<span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; var xml:XML = new XML<span style="color:#006600; font-weight:bold;">&#40;</span>e.<span style="">target</span>.<span style="">data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; var xmlList:XMLList = xml.<span style="">folder</span>.<span style="">file</span>;<br />
&nbsp; &nbsp; var dataProvider = new DataProvider<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; for each <span style="color:#006600; font-weight:bold;">&#40;</span>var item in xmlList<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dataProvider.<span style="">addItem</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>label:item<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; &nbsp; listado.<span style="">dataProvider</span> = dataProvider;<br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
</div>
<p></p>
<p>Cargamos el archivo PHP como si de un XML se tratase, y de ahí lo convertimos en el dataProvider del componente.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Comparte:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F" title="Meneame"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Listar%20archivos%20de%20un%20directorio%20web%20con%20PHP%20y%20XML%20-%20http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F" title="Twitter"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F&amp;t=Listar%20archivos%20de%20un%20directorio%20web%20con%20PHP%20y%20XML" title="Facebook"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F&amp;title=Listar%20archivos%20de%20un%20directorio%20web%20con%20PHP%20y%20XML&amp;annotation=Este%20es%20un%20sencillo%20script%20de%20%20que%20nos%20permite%20generar%20un%20archivo%20XML%20con%20el%20listado%20de%20todos%20los%20archivos%20y%20carpetas%20que%20esten%20contenidos%20dentro%20del%20directorio%20en%20el%20que%20hemos%20situado%20el%20archivo%20PHP.%0D%0A%0D%0AEsto%20nos%20puede%20resultar%20%C3%BAtil%20para%20realizar%20ga" title="Google Bookmarks"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F&amp;title=Listar%20archivos%20de%20un%20directorio%20web%20con%20PHP%20y%20XML&amp;notes=Este%20es%20un%20sencillo%20script%20de%20%20que%20nos%20permite%20generar%20un%20archivo%20XML%20con%20el%20listado%20de%20todos%20los%20archivos%20y%20carpetas%20que%20esten%20contenidos%20dentro%20del%20directorio%20en%20el%20que%20hemos%20situado%20el%20archivo%20PHP.%0D%0A%0D%0AEsto%20nos%20puede%20resultar%20%C3%BAtil%20para%20realizar%20ga" title="del.icio.us"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F" title="Technorati"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Listar%20archivos%20de%20un%20directorio%20web%20con%20PHP%20y%20XML&amp;body=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F" title="email"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.codigoactionscript.org%2Flistar-archivos-de-un-directorio-web-con-php-y-xml%2F&amp;partner=sociable" title="Print"><img src="http://www.codigoactionscript.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.codigoactionscript.org/impedir-la-visualizacion-de-archivos-swf-individualmente/' rel='bookmark' title='Permanent Link: Impedir la visualización de archivos SWF individualmente'>Impedir la visualización de archivos SWF individualmente</a></li>
<li><a href='http://www.codigoactionscript.org/adm-aplicacion-air-para-editar-archivos-de-configuracion/' rel='bookmark' title='Permanent Link: ADM, aplicación AIR para editar archivos de configuración'>ADM, aplicación AIR para editar archivos de configuración</a></li>
<li><a href='http://www.codigoactionscript.org/cargar-xml-en-un-componente-list-en-actionscript-3/' rel='bookmark' title='Permanent Link: Cargar XML en un componente List en Actionscript 3'>Cargar XML en un componente List en Actionscript 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codigoactionscript.org/listar-archivos-de-un-directorio-web-con-php-y-xml/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
