<?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>Calle Serpis &#187; swf</title>
	<atom:link href="http://blog.calleserpis.com/tag/swf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.calleserpis.com</link>
	<description></description>
	<lastBuildDate>Mon, 02 Aug 2010 09:10:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Comunicar varios swf mediante mdm.Forms</title>
		<link>http://blog.calleserpis.com/zinc/comunicar-varios-swf-mediante-mdmforms/</link>
		<comments>http://blog.calleserpis.com/zinc/comunicar-varios-swf-mediante-mdmforms/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 11:29:04 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[MDM Zinc]]></category>
		<category><![CDATA[mdm.Forms]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://blog.calleserpis.com/?p=7792</guid>
		<description><![CDATA[<p>Existe la posibilidad de comunicarnos entre distintos swf usando mdm zinc mediante la clase mdm.Forms. Esto nos puede ayudar mucho a no cargar tantos nuestros swf en las aplicaciones que desarrollemos. Así podemos tener por ejemplo en un swf, la carga de clientes con sus detalles y en otro nuestra aplicación principal.  Así mientras trabajamos en la aplicación, cuando debemos seleccionar el cliente, se nosa cargará el swf en otra "Ventana" (Formulario) y no perderemos la ventana principal.</p>
<p>Voy a mostraros un ejemplo muy muy sencillo en el que lo podáis ver fácilmente. He creado un swf que tiene un input text y un boton que al pulsarlo se escribe en un textarea lo que hemos puesto en el input text.</p>
<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">boton.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">escribir<span style="color: #66cc66;">&#40;</span><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> escribir<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">algo=campo_txt.<span style="color: #0066CC;">text</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">texto_txt.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">"Escribimos y le mandamos "</span>+algo+<span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>+texto_txt.<span style="color: #0066CC;">text</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>Y luego tenemos otro botón que hace visible el segundo formulario:</p>
<div class="igBar"><span id="lactionscript-5"><a href="#" onclick="javascript:showPlainTxt('actionscript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-5">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">botondos.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">dosForm</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">dosForm</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Luego en el segundo swf tenemos solamente dos botones, uno que llama a la función escribir() que está en el primer swf, y otro botón que nos meneará el primer formulario.</p>
<div class="igBar"><span id="lactionscript-6"><a href="#" onclick="javascript:showPlainTxt('actionscript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-6">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">botonparauno.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">MainForm</span>.<span style="color: #006600;">callFunction</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"escribir"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"|"</span><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">botonmeneauno.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">MainForm</span>.<span style="color: #006600;">shake</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">5</span><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:#3A6A8B;">
<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>Para poder llamar a la función de otro swf usamos la función mdm.Forms.<strong>NombreFormulario</strong>.callFunction(functionName:String,  parametersString:String, delimiter:String), de esta manera desde cualquier parte de nuestra aplicación podremos llamar a las funciones declaradas en cualquier swf.</p>
<p> </p>
<p><a title="Descargar Ejemplo" href="http://www.calleserpis.com/ejemplos/ejemplo_forms.rar" target="_blank">Descargar ejemplo</a>.</p>
                <p><hr/><font size="-1"><center>&copy; 2007-2008 - Visita <a href="http://www.calleserpis.com">Calle Serpis</a> para ver más contenido. | Si estás viendo este post en un lugar distinto a su feed es que no es original.</center></font></p>            <div style="display:block"><small><em>posted in <a href="http://blog.calleserpis.com/category/flash/">Flash</a> by Juan <br />&copy;2010 <a href="http://blog.calleserpis.com">Calle Serpis</a>. All Rights Reserved.</em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Existe la posibilidad de comunicarnos entre distintos swf usando mdm zinc mediante la clase mdm.Forms. Esto nos puede ayudar mucho a no cargar tantos nuestros swf en las aplicaciones que desarrollemos. Así podemos tener por ejemplo en un swf, la carga de clientes con sus detalles y en otro nuestra aplicación principal.  Así mientras trabajamos en la aplicación, cuando debemos seleccionar el cliente, se nosa cargará el swf en otra "Ventana" (Formulario) y no perderemos la ventana principal.</p>
<p>Voy a mostraros un ejemplo muy muy sencillo en el que lo podáis ver fácilmente. He creado un swf que tiene un input text y un boton que al pulsarlo se escribe en un textarea lo que hemos puesto en el input text.</p>
<div class="igBar"><span id="lactionscript-7"><a href="#" onclick="javascript:showPlainTxt('actionscript-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-7">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">boton.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">escribir<span style="color: #66cc66;">&#40;</span><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> escribir<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">algo=campo_txt.<span style="color: #0066CC;">text</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">texto_txt.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">"Escribimos y le mandamos "</span>+algo+<span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span>+texto_txt.<span style="color: #0066CC;">text</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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>Y luego tenemos otro botón que hace visible el segundo formulario:</p>
<div class="igBar"><span id="lactionscript-8"><a href="#" onclick="javascript:showPlainTxt('actionscript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-8">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">botondos.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">dosForm</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">dosForm</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Luego en el segundo swf tenemos solamente dos botones, uno que llama a la función escribir() que está en el primer swf, y otro botón que nos meneará el primer formulario.</p>
<div class="igBar"><span id="lactionscript-9"><a href="#" onclick="javascript:showPlainTxt('actionscript-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-9">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">botonparauno.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">MainForm</span>.<span style="color: #006600;">callFunction</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"escribir"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"|"</span><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">botonmeneauno.<span style="color: #0066CC;">onRelease</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mdm.<span style="color: #006600;">Forms</span>.<span style="color: #006600;">MainForm</span>.<span style="color: #006600;">shake</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">5</span><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:#3A6A8B;">
<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>Para poder llamar a la función de otro swf usamos la función mdm.Forms.<strong>NombreFormulario</strong>.callFunction(functionName:String,  parametersString:String, delimiter:String), de esta manera desde cualquier parte de nuestra aplicación podremos llamar a las funciones declaradas en cualquier swf.</p>
<p> </p>
<p><a title="Descargar Ejemplo" href="http://www.calleserpis.com/ejemplos/ejemplo_forms.rar" target="_blank">Descargar ejemplo</a>.</p>
                <p><hr/><font size="-1"><center>&copy; 2007-2008 - Visita <a href="http://www.calleserpis.com">Calle Serpis</a> para ver más contenido. | Si estás viendo este post en un lugar distinto a su feed es que no es original.</center></font></p>            ]]></content:encoded>
			<wfw:commentRss>http://blog.calleserpis.com/zinc/comunicar-varios-swf-mediante-mdmforms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
