<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comentarios en: Cargar SWF en Flex</title>
	<atom:link href="http://www.codigometropoli.com/cargar-swf-en-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codigometropoli.com/cargar-swf-en-flex/</link>
	<description>Programación para Super Héroes</description>
	<lastBuildDate>Tue, 31 Aug 2010 13:41:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Por: piruja</title>
		<link>http://www.codigometropoli.com/cargar-swf-en-flex/comment-page-1/#comment-2624</link>
		<dc:creator>piruja</dc:creator>
		<pubDate>Thu, 22 Jul 2010 19:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.codigometropoli.com/?p=19#comment-2624</guid>
		<description>Hola, he seguido todos los pasos. Si copio el .swf donde dices no aparece al ejecutar la aplicación, así que lo he puesto en la ruta donde se guarda todo y ahí si que aparece. El problema está en que cuando interactúo con él me dan los siguientes errores dependiendo del botón en el que pulse:
ReferenceError: Error #1056: Cannot create property mensaje on Aplicacion.
	at flash_fla::MainTimeline/pasar_valor()

ReferenceError: Error #1069: Property muestraAlert not found on Aplicacion and there is no default value.
	at flash_fla::MainTimeline/llamar_funcion()


¿Que estoy haciendo mal? ¿Alguien podrñia ayudarme?
Muchas gracias</description>
		<content:encoded><![CDATA[<p>Hola, he seguido todos los pasos. Si copio el .swf donde dices no aparece al ejecutar la aplicación, así que lo he puesto en la ruta donde se guarda todo y ahí si que aparece. El problema está en que cuando interactúo con él me dan los siguientes errores dependiendo del botón en el que pulse:<br />
ReferenceError: Error #1056: Cannot create property mensaje on Aplicacion.<br />
	at flash_fla::MainTimeline/pasar_valor()</p>
<p>ReferenceError: Error #1069: Property muestraAlert not found on Aplicacion and there is no default value.<br />
	at flash_fla::MainTimeline/llamar_funcion()</p>
<p>¿Que estoy haciendo mal? ¿Alguien podrñia ayudarme?<br />
Muchas gracias</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Carlos Dk</title>
		<link>http://www.codigometropoli.com/cargar-swf-en-flex/comment-page-1/#comment-2434</link>
		<dc:creator>Carlos Dk</dc:creator>
		<pubDate>Tue, 01 Jun 2010 08:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.codigometropoli.com/?p=19#comment-2434</guid>
		<description>Muy bueno! gracias :D

www.vertutoriales.com</description>
		<content:encoded><![CDATA[<p>Muy bueno! gracias <img src='http://www.codigometropoli.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://www.vertutoriales.com" rel="nofollow">http://www.vertutoriales.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Victorious</title>
		<link>http://www.codigometropoli.com/cargar-swf-en-flex/comment-page-1/#comment-2362</link>
		<dc:creator>Victorious</dc:creator>
		<pubDate>Mon, 10 May 2010 15:34:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.codigometropoli.com/?p=19#comment-2362</guid>
		<description>Esta todo OK en AS3, pero como podria funcionar en AS2?</description>
		<content:encoded><![CDATA[<p>Esta todo OK en AS3, pero como podria funcionar en AS2?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Carla Macías</title>
		<link>http://www.codigometropoli.com/cargar-swf-en-flex/comment-page-1/#comment-158</link>
		<dc:creator>Carla Macías</dc:creator>
		<pubDate>Thu, 13 Nov 2008 16:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codigometropoli.com/?p=19#comment-158</guid>
		<description>Hola Jorge,

No había podido revisar tu código hasta hoy.
El problema es que se está haciendo el siguiente ciclo:

1. Cargas el primer SWF (208M-1I.swf)
2. Se llama a la función CargaCompleta
3. Haces click en el botón boton_salir
4. Se llama a la función uno
5. Se carga el segundo SWF (208M-1R.swf)
6. Se llama a la función CargaCompleta

Ahí truena porque de seguro en la segundo SWF no tienes un objeto botón que se llame objeto_salida; y en la función CargaCompleta lo estás llamando:

e.target.content.objeto_salida.addEventListener(Event.COMPLETE,uno);

Lo que puedes ver es revisar la propiedad &lt;strong&gt;source&lt;/strong&gt; del &lt;strong&gt;target&lt;/strong&gt; del evento que se generó para ver si agregas o no el listener. Ejemplo:

[as]
public function CargaCompleta(e:Event):void
{
	try
	{
		if(e.currentTarget.source != &quot;208M-1R.swf&quot;)
			e.target.content.objeto_salida.addEventListener(Event.COMPLETE,uno);
	}
	catch(er:Error) {Alert.show(er.message,&quot;Error&quot;);}
}
[/as]

Saludos.</description>
		<content:encoded><![CDATA[<p>Hola Jorge,</p>
<p>No había podido revisar tu código hasta hoy.<br />
El problema es que se está haciendo el siguiente ciclo:</p>
<p>1. Cargas el primer SWF (208M-1I.swf)<br />
2. Se llama a la función CargaCompleta<br />
3. Haces click en el botón boton_salir<br />
4. Se llama a la función uno<br />
5. Se carga el segundo SWF (208M-1R.swf)<br />
6. Se llama a la función CargaCompleta</p>
<p>Ahí truena porque de seguro en la segundo SWF no tienes un objeto botón que se llame objeto_salida; y en la función CargaCompleta lo estás llamando:</p>
<p>e.target.content.objeto_salida.addEventListener(Event.COMPLETE,uno);</p>
<p>Lo que puedes ver es revisar la propiedad <strong>source</strong> del <strong>target</strong> del evento que se generó para ver si agregas o no el listener. Ejemplo:</p>
<div class="igBar"><span id="lactionscript-1"><a href="#" onclick="javascript:showPlainTxt('actionscript-1'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-1">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#2C442A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> CargaCompleta<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></div>
</li>
<li style="font-weight: bold;color:#0B1558;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#2C442A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">try</span></div>
</li>
<li style="font-weight: bold;color:#0B1558;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#2C442A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">source</span> != <span style="color: #ff0000;">"208M-1R.swf"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#0B1558;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">content</span>.<span style="color: #006600;">objeto_salida</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>,uno<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#2C442A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#0B1558;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">catch</span><span style="color: #66cc66;">&#40;</span>er:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span>er.<span style="color: #0066CC;">message</span>,<span style="color: #ff0000;">"Error"</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#2C442A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Saludos.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Jorge</title>
		<link>http://www.codigometropoli.com/cargar-swf-en-flex/comment-page-1/#comment-155</link>
		<dc:creator>Jorge</dc:creator>
		<pubDate>Tue, 11 Nov 2008 22:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.codigometropoli.com/?p=19#comment-155</guid>
		<description>mx:SWFLoader id=&quot;s1&quot;  width=&quot;278&quot; height=&quot;251&quot; complete=&quot;CargaCompleta(event)&quot; source=&quot;recursos/interactivos/208M-1I.swf&quot;&gt;
	</description>
		<content:encoded><![CDATA[<p>mx:SWFLoader id="s1"  width="278" height="251" complete="CargaCompleta(event)" source="recursos/interactivos/208M-1I.swf"&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
