<?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>Erko Bridee &#187; Desenvolvimento</title>
	<atom:link href="http://blog.erkobridee.com/c/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.erkobridee.com</link>
	<description>Uma visão particular de assuntos atuais…</description>
	<lastBuildDate>Fri, 30 Jul 2010 13:36:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava</title>
		<link>http://blog.erkobridee.com/2010/07/24/adobe-air-2-nativeprocess-java-simpleairjava/</link>
		<comments>http://blog.erkobridee.com/2010/07/24/adobe-air-2-nativeprocess-java-simpleairjava/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 20:29:23 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[AIR 2.0]]></category>
		<category><![CDATA[Código]]></category>
		<category><![CDATA[Exemplo]]></category>
		<category><![CDATA[NativeProcess]]></category>
		<category><![CDATA[Projeto]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2231</guid>
		<description><![CDATA[Estou disponibilizando um exemplo de como integrar de maneira simples e efetuar uma comunicação textual entre um aplicativo Adobe AIR 2 com uma aplicação Java...]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F24%2Fadobe-air-2-nativeprocess-java-simpleairjava%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F24%2Fadobe-air-2-nativeprocess-java-simpleairjava%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Estou disponibilizando um exemplo de como integrar de maneira simples e efetuar uma comunicação textual entre um aplicativo Adobe AIR 2 com uma aplicação Java&#8230;</p>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/07/SimpleAirJava_UI.png"><img class="aligncenter size-full wp-image-2232" title="SimpleAirJava_UI" src="http://blog.erkobridee.com/wp-content/uploads/2010/07/SimpleAirJava_UI.png" alt="" width="400" /></a></p>
<p><strong>Lembrete:</strong> para pode utilizar o recurso NaticeProcess é necessário efetuar uma configuração no xml que define as informações de execução da aplicação, você precisará definir a tag: <em>&lt;supportedProfiles&gt;extendedDesktop&lt;/supportedProfiles&gt;</em> conforme pode ser visto [<a href="http://code.google.com/p/erkobridee/source/browse/trunk/adobe_air/nativeprocess/Java/SimpleAirJava/proj/SimpleAirJava_UI/src/SimpleAirJava-app.xml" target="_blank">SimpleAirJava-app.xml</a>]</p>
<p><br class="spacer_" /></p>
<p><strong>Atualizado:</strong> 20100725 2300</p>
<p style="padding-left: 30px;">Incluído campo para definir o caminho do javaw no computador local</p>
<p><strong>Download:</strong> <a href="http://erkobridee.googlecode.com/files/SimpleAirJava.zip">SimpleAirJava.zip</a></p>
<p><strong>SVN:</strong> ( Google Code, acesso para leitura)</p>
<p><em>http://erkobridee.googlecode.com/svn/trunk/adobe_air/nativeprocess/Java/SimpleAirJava</em></p>
<p><br class="spacer_" /></p>
<p>Para facilitar uma visualização rápida dos código, segue os links:</p>
<p style="padding-left: 30px;"><strong>SimpleAirJava_UI</strong> [ aplicação Adobe AIR ] ( UI &#8211; User Interface )</p>
<p style="padding-left: 60px;"><a href="http://code.google.com/p/erkobridee/source/browse/trunk/adobe_air/nativeprocess/Java/SimpleAirJava/proj/SimpleAirJava_UI/src/SimpleAirJava.mxml" target="_blank">SimpleAirJava.mxml</a></p>
<p style="padding-left: 60px;"><a href="http://code.google.com/p/erkobridee/source/browse/trunk/adobe_air/nativeprocess/Java/SimpleAirJava/proj/SimpleAirJava_UI/src/code/App.as" target="_blank">App.as</a></p>
<p style="padding-left: 60px;"><a href="http://code.google.com/p/erkobridee/source/browse/trunk/adobe_air/nativeprocess/Java/SimpleAirJava/proj/SimpleAirJava_UI/src/SimpleAirJava-app.xml" target="_blank">SimpleAirJava-app.xml</a></p>
<p style="padding-left: 30px;"><strong>SimpleAirJava_NP</strong> [ aplicação Java ] ( NP &#8211; NativeProcess )</p>
<p style="padding-left: 60px;"><a href="http://code.google.com/p/erkobridee/source/browse/trunk/adobe_air/nativeprocess/Java/SimpleAirJava/proj/SimpleAirJava_NP/src/com/erkobridee/simpleairjava/RunApp.java" target="_blank">RunApp.java</a></p>
<p><br class="spacer_" /></p>
<p>Espero que ajude a compreender um pouco como integrar AIR + Java localmente.</p>
<p style="padding-left: 30px;"><strong>Obs.: </strong>ainda existe a obrigatoriedade de gerar um instalador nativo para poder distribuir e utilizar o <strong><em>NativeProcess</em><span style="font-weight: normal;"> na aplicação instalada.</span></strong></p>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2231&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/22/adobe-air-2-nativeprocess-projeto-de-exemplo-windows-console/" title="[Adobe AIR 2 : NativeProcess] projeto de exemplo : Windows Console">[Adobe AIR 2 : NativeProcess] projeto de exemplo : Windows Console</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/" title="Adobe Flash Builder + Flex 4 + BlazeDS 4">Adobe Flash Builder + Flex 4 + BlazeDS 4</a></li><li><a href="http://blog.erkobridee.com/2010/03/27/actionscript-3-flash-player-10-localfilehelper/" title="ActionScript 3 + Flash Player 10+ : LocalFileHelper">ActionScript 3 + Flash Player 10+ : LocalFileHelper</a></li><li><a href="http://blog.erkobridee.com/2009/10/26/adobe-flex-httpservice-enviando-parametros-para-a-aplicacao-web-em-java/" title="Adobe Flex (HttpService) enviando parametros para a aplicação web em Java">Adobe Flex (HttpService) enviando parametros para a aplicação web em Java</a></li><li><a href="http://blog.erkobridee.com/2010/07/21/flerry-adobe-air-2-conversando-com-java-local-em-amf-via-nativeprocess/" title="[ Flerry ] Adobe AIR 2 conversando com Java local em AMF via NativeProcess">[ Flerry ] Adobe AIR 2 conversando com Java local em AMF via NativeProcess</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/07/24/adobe-air-2-nativeprocess-java-simpleairjava/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ Flerry ] Adobe AIR 2 conversando com Java local em AMF via NativeProcess</title>
		<link>http://blog.erkobridee.com/2010/07/21/flerry-adobe-air-2-conversando-com-java-local-em-amf-via-nativeprocess/</link>
		<comments>http://blog.erkobridee.com/2010/07/21/flerry-adobe-air-2-conversando-com-java-local-em-amf-via-nativeprocess/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 05:40:25 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[AIR 2.0]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[Flerry]]></category>
		<category><![CDATA[Jar]]></category>
		<category><![CDATA[Local]]></category>
		<category><![CDATA[NaticeProcess]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2205</guid>
		<description><![CDATA[Um post interessante, como integrar sua aplicação Adobe AIR 2 a uma aplicação Java para ampliar as funcionalidades e acesso de hardware da sua aplicação AIR, tudo isso através da nova funcionalidade NativeProcess do AIR 2.0]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F21%2Fflerry-adobe-air-2-conversando-com-java-local-em-amf-via-nativeprocess%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F21%2Fflerry-adobe-air-2-conversando-com-java-local-em-amf-via-nativeprocess%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Um post interessante, como integrar sua aplicação Adobe AIR 2 a uma aplicação Java para ampliar as funcionalidades e acesso de hardware da sua aplicação AIR, tudo isso através da nova funcionalidade NativeProcess do AIR 2.0.</p>
<p><br class="spacer_" /></p>
<p>Este post surgiu da necessidade de desenvolver um aplicativo multi-plataforma  (Windows, Linux e Mac) onde eu tenho a necessidade de acessar mais informações de hardware do que tenho acessível pelo Adobe AIR, então sabendo do novo recurso chamado <strong><em>NativeProcess</em><span style="font-weight: normal;"> do Adobe AIR 2.0, o qual me permite acessar um processo nativo na máquina, parti para esta linha a procura de uma solução que me atenda a necessidade.</span></strong></p>
<p><br class="spacer_" /></p>
<p>Visão geral de como funciona o <strong><em>NativeProcess</em></strong></p>
<p><strong><span style="font-weight: normal;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/07/AIR2_NativeProcess_View.png"><img class="aligncenter size-full wp-image-2207" title="AIR2_NativeProcess_View" src="http://blog.erkobridee.com/wp-content/uploads/2010/07/AIR2_NativeProcess_View.png" alt="" width="270" height="300" /></a><br />
 </span></strong></p>
<p><strong>A primeira vista:</strong> caramba esse recurso do <strong><em>NativeProcess</em><span style="font-weight: normal;"> é bom demais, até esse momento eu estava apenas vendo os tutoriais, vídeos e apresentações do assunto, então quando fui colocar a mão na massa&#8230;</span></strong></p>
<p><strong>A segunda vista: </strong>nem tudo são rosas, o esquema de <strong><em>NativeProcess</em><span style="font-weight: normal;"> funcionam muito bem, entretanto, achei ele um tanto limitado, pois tenho que fazer um executável do respectivo Sistema Operacional que quero e chamar pelo </span><em>NativeProcess</em><span style="font-weight: normal;"> a execução deste executável. Mas eu quero é usar o java&#8230; como faz?</span></strong></p>
<p><strong><span style="font-weight: normal;"><br />
 </span></strong></p>
<p>Então me deparei com a imagem em uma apresentação:</p>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/07/AIR2_NativeInstaller.png"><img class="aligncenter size-full wp-image-2208" title="AIR2_NativeInstaller" src="http://blog.erkobridee.com/wp-content/uploads/2010/07/AIR2_NativeInstaller.png" alt="" width="500" height="273" /></a></p>
<p>Onde mostra uma nova funcionalidade do Adobe AIR 2.0, que você pode &#8220;amarrar&#8221; sua aplicação a a um sistema operacional. Bom no caso do Android não temos muito o que fazer por hoje, visto a limitação de hardware, então é um caso a parte, porém para os demais SO, não vejo em meu caso um motivo justificável para criar esses instaladores e atrelar meu aplicativo a um aplicativo nativo do SO.</p>
<p><br class="spacer_" /></p>
<p>Por curiosidade, os comandos para gerar estes instaladores nativos são:</p>
<blockquote><p>Lembrando que o <strong>adt</strong> fica no diretório /bin da instalação do SDK do Adobe AIR.</p>
</blockquote>
<p><strong>Exemplo de linha de comando:</strong></p>
<p><br class="spacer_" /></p>
<p>adt -package -target native &lt;nome e diretório de saída&gt; &lt;nome e diretório do arquivo .air&gt;</p>
<p><br class="spacer_" /></p>
<p><strong>Exemplos:</strong></p>
<p><br class="spacer_" /></p>
<p style="padding-left: 30px;"><strong><em>Windows:</em></strong></p>
<p>adt -package -target native C:\AIRSamples\AIRSample.exe C:\AIRSamples\AIRSample.air</p>
<p><br class="spacer_" /></p>
<p style="padding-left: 30px;"><strong><em>Mac:</em></strong></p>
<p>adt -package -target native C:\AIRSamples\AIRSample.dmg C:\AIRSamples\AIRSample.air</p>
<p><br class="spacer_" /></p>
<p style="padding-left: 30px;"><strong><em>Linux:</em></strong></p>
<p>adt -package -target native C:\AIRSamples\AIRSample.rpm C:\AIRSamples\AIRSample.air</p>
<p><br class="spacer_" /></p>
<p><span style="font-weight: normal;"><strong>Calma nem tudo está perdido! na próxima página tem mais&#8230;</strong></span></p>
<p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2205&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/24/adobe-air-2-nativeprocess-java-simpleairjava/" title="[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava">[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava</a></li><li><a href="http://blog.erkobridee.com/2010/07/22/adobe-air-2-nativeprocess-projeto-de-exemplo-windows-console/" title="[Adobe AIR 2 : NativeProcess] projeto de exemplo : Windows Console">[Adobe AIR 2 : NativeProcess] projeto de exemplo : Windows Console</a></li><li><a href="http://blog.erkobridee.com/2010/05/12/adobe-flex-blazeds-e-um-problema-de-conexao-no-servidor/" title="Adobe Flex + BlazeDS e um problema de conexão no servidor">Adobe Flex + BlazeDS e um problema de conexão no servidor</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/" title="Adobe Flash Builder + Flex 4 + BlazeDS 4">Adobe Flash Builder + Flex 4 + BlazeDS 4</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/" title="Adobe Flex 3.5 : UploadDownloadBlazeDS">Adobe Flex 3.5 : UploadDownloadBlazeDS</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/07/21/flerry-adobe-air-2-conversando-com-java-local-em-amf-via-nativeprocess/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Flex &amp; AIR] Swiz Framework &#8211; meus primeiros passos</title>
		<link>http://blog.erkobridee.com/2010/07/13/flex-air-swiz-framework-meus-primeiros-passos/</link>
		<comments>http://blog.erkobridee.com/2010/07/13/flex-air-swiz-framework-meus-primeiros-passos/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 02:04:19 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Swiz]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2125</guid>
		<description><![CDATA[Há certo tempo estava pensando em deixar de utilizar o Mate Framework devido a uma falta de suporte mais robusta ao desenvolvimento de aplicações em Adobe AIR, então durante o FlexMania 2010, um uma palestra que abordava o tema Flex 4 - Desenvolvendo com Portabilidade(Web, Desktop e Mobile), pude ver um uso prático e fácil do Swiz Framework que me motivou a iniciar meus estudos e uso deste framework para as futuras aplicações que serão desenvolvidas. Neste post irei compartilhar o que até aqui ajuntei de informações...]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F13%2Fflex-air-swiz-framework-meus-primeiros-passos%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F13%2Fflex-air-swiz-framework-meus-primeiros-passos%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Há certo tempo estava pensando em deixar de utilizar o Mate Framework devido a uma falta de suporte mais robusta ao desenvolvimento de aplicações em Adobe AIR, então durante o FlexMania 2010, um uma palestra que abordava o tema Flex 4 &#8211; Desenvolvendo com Portabilidade(Web, Desktop e Mobile), pude ver um uso prático e fácil do Swiz Framework que me motivou a iniciar meus estudos e uso deste framework para as futuras aplicações que serão desenvolvidas. Neste post irei compartilhar o que até aqui ajuntei de informações&#8230;</p>
<p><br class="spacer_" /></p>
<p style="text-align: center;"><strong>Swiz Framework:</strong> <a href="http://swizframework.org/">Site</a> | <a title="Twitter" href="http://twitter.com/swizframework">@SwizFramework</a> | <a href="http://swizframework.jira.com/wiki/display/SWIZ/Home">Wiki</a></p>
<p><br class="spacer_" /></p>
<p><strong>Segundo a definição do Wiki temos:</strong></p>
<p>O Swiz é um framework para Adobe Flex, Flash e AIR para fornecer um completo suporte ao desenvolvimento de soluções RIA. O Swiz te proporciona:</p>
<ul>
<li>Inversão de Controle</li>
<li>Injeção de Dependência</li>
<li>Tratamento de eventos e      mediação</li>
<li>Um cliclo de vida simples      para métodos remotos assíncronos</li>
<li>Um framework desaclopado do      código da sua aplicação</li>
</ul>
<p><br class="spacer_" /></p>
<p>Indo na contramão da maioria dos frameworks para Flex, o Swiz:</p>
<ul>
<li>Não impõem o uso de nenhum      padrão JEE no código da sua aplicação</li>
<li>Não repete estrutura de      pastas</li>
<li>Não te força utilizar      nenhuma estrutura de código predefinida</li>
<li>Não te obriga a estender      nenhuma classe específica do framework</li>
</ul>
<p>O Swiz representa o melhor das práticas aprendidas dos melhores desenvolvedores de RIA de algumas das melhoras empresas de consultoria da indústria, possibilitando assim que o Swiz seja, simples, leve e extremamente produtivo.</p>
<blockquote><p>De início um ponto que me chamou a atenção e me agradou muito no Swiz, a documentação de como utilizar o Swiz disponível na <a href="http://swizframework.jira.com/wiki/display/SWIZ/Home">Wiki</a> é simples, fácil e clara, a qual recomendo a leitura. Após uma leitura, veja este exemplo de uso do Swiz [<a href="http://github.com/swiz/swiz-examples/tree/master/CafeTownsend-Flex4">CafeTownsend-Flex4</a>].</p>
</blockquote>
<p><br class="spacer_" /></p>
<p><strong>Links antigos que auxiliam na compreensão do Swiz Framework:</strong></p>
<p style="padding-left: 30px;"><a href="http://tv.adobe.com/watch/360flex-conference/introduction-to-the-swiz-framework-for-flex-by-chris-scott">Adobe TV &#8211; Introducing Swiz [19/08/2008]</a></p>
<blockquote><p style="padding-left: 30px;">Possui uma explicação ampla sobre o framework.</p>
</blockquote>
<p style="padding-left: 30px;"><a href="http://coenraets.org/blog/2009/02/sample-application-using-the-swiz-framework-and-blazeds/">Christophe Coenraets &#8211; uma aplicação simples usando o Swiz Framework e BlazeDS</a></p>
<blockquote><p style="padding-left: 30px;">Exemplo bem interessante, onde um ponto a ser observado foi como foi definido o acesso ao RemoteObject através do Swiz.</p>
</blockquote>
<p style="padding-left: 30px;"><a href="http://www.briankotek.com/blog/index.cfm/2009/1/8/Using-Swiz-Part-1-Initial-Setup">Using Swiz Part 1: Initial Setup</a></p>
<blockquote><p style="padding-left: 30px;">Conjunto de post sobre o uso do Swiz, atentar aos links relacionados do post.</p>
</blockquote>
<p style="padding-left: 30px;">Swiz in 20 minutes</p>
<p style="text-align: center;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7166397&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="500" height="390" src="http://vimeo.com/moogaloop.swf?clip_id=7166397&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object>
</p>
<blockquote><p style="padding-left: 30px;">Neste vídeo podemos te uma visão clara do poder e facilidade de uso do Swiz Framework e observar um detalhe que para mim é extremamente importante, nenhum código extra além da lógica da nossa aplicação, com isto o Swiz consegue ser fiel ao que se propõem&#8230;</p>
</blockquote>
<p><br class="spacer_" /></p>
<p><strong>Links recentes sobre Swiz Framework:</strong></p>
<p style="padding-left: 30px;">Jandersonfc</p>
<p style="padding-left: 60px;"><a href="http://experts.na3.acrobat.com/p68675758/">#flexmania 2010 &#8211; Flex 4 &#8211; Desenvolvendo com Portabilidade(Web, Desktop e Mobile)</a></p>
<blockquote><p style="padding-left: 60px;">Esta foi a palestra a qual me referi no início do post.</p>
</blockquote>
<p style="padding-left: 60px;"><a href="http://www.jandersonfc.com/flexmania-2010-disponibilizando-codigo-fonte/">#flexmania 2010 – disponibilizando código fonte</a></p>
<blockquote><p style="padding-left: 60px;">Material da Palestra.</p>
</blockquote>
<p style="padding-left: 60px;"><a href="http://www.jandersonfc.com/tag/swiz-framework/">Swiz Framework</a></p>
<blockquote><p style="padding-left: 60px;">Publicações no blog abordando o assunto.</p>
</blockquote>
<p style="padding-left: 30px;"><a href="http://www.flexria.com.br/home/?p=139">Flex &amp; RIA  - Swiz Prototype</a></p>
<p style="padding-left: 30px;"><a href="http://www.as3offcuts.com/2010/06/swiz-in-actionscript-projects-including-flash-ide-projects/">Swiz in Actionscript Projects (including Flash IDE projects)</a></p>
<blockquote><p style="padding-left: 30px;">Para quem tiver interesse em utilizar o Swiz Framework sem ser em um projeto Flex ou AIR é interessante a leitura desse post.</p>
</blockquote>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2125&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/18/flex-air-swiz-framework-presentation-model-exemplo-de-projeto/" title="[Flex &#038; AIR] Swiz Framework + Presentation Model : Exemplo de Projeto">[Flex &#038; AIR] Swiz Framework + Presentation Model : Exemplo de Projeto</a></li><li><a href="http://blog.erkobridee.com/2009/05/19/java-magazine-68-artigo-sobre-adobe-flex-e-air/" title="Java Magazine 68 : Artigo sobre Adobe Flex e AIR">Java Magazine 68 : Artigo sobre Adobe Flex e AIR</a></li><li><a href="http://blog.erkobridee.com/2010/07/09/flexmania-2010-adobe-flex-oracle-weblogic-10-x/" title="FlexMania 2010 &#8211; Adobe Flex + Oracle WebLogic 10.x">FlexMania 2010 &#8211; Adobe Flex + Oracle WebLogic 10.x</a></li><li><a href="http://blog.erkobridee.com/2009/11/16/o-que-e-o-adobe-flex/" title="O que é o Adobe Flex?">O que é o Adobe Flex?</a></li><li><a href="http://blog.erkobridee.com/2009/10/19/facebook-aplicacao-desktop/" title="Facebook : Aplicação desktop">Facebook : Aplicação desktop</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/07/13/flex-air-swiz-framework-meus-primeiros-passos/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>FlexMania 2010 &#8211; Adobe Flex + Oracle WebLogic 10.x</title>
		<link>http://blog.erkobridee.com/2010/07/09/flexmania-2010-adobe-flex-oracle-weblogic-10-x/</link>
		<comments>http://blog.erkobridee.com/2010/07/09/flexmania-2010-adobe-flex-oracle-weblogic-10-x/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 04:55:22 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Palestra & Evento]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash Buillder]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexMania]]></category>
		<category><![CDATA[FlexMania2010]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Workshop 10gR3]]></category>
		<category><![CDATA[WebLogic]]></category>
		<category><![CDATA[WebLogic 10x]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2059</guid>
		<description><![CDATA[Slides e demais informações complementares referente a minha palestra no FlexMania 2010]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F09%2Fflexmania-2010-adobe-flex-oracle-weblogic-10-x%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F07%2F09%2Fflexmania-2010-adobe-flex-oracle-weblogic-10-x%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/07/flexmania2010_banner-250-200.jpg"><img class="aligncenter size-full wp-image-2107" title="flexmania2010_banner-250-200" src="http://blog.erkobridee.com/wp-content/uploads/2010/07/flexmania2010_banner-250-200.jpg" alt="" width="250" height="200" /></a><a href="http://flexmania.com.br/">FlexMania 2010</a></p>
<p><br class="spacer_" /></p>
<p>Slides e demais informações complementares referente a minha palestra no FlexMania 2010.</p>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/07/flex_oracle_workshop_10gr3.png"><img class="aligncenter size-full wp-image-2062" title="flex_oracle_workshop_10gr3" src="http://blog.erkobridee.com/wp-content/uploads/2010/07/flex_oracle_workshop_10gr3.png" alt="" width="450" height="400" /></a></p>
<p>Depois de um dia muito corrido de trabalho, na noite de quinta-feira (08/07/2010), as 19:30 as 20:30, foi realizada a minha palestra sobre o assunto: <em><strong>Adobe Flex + Oracle WebLogic 10.x</strong></em> no mais tradicional do meu estilo de vida: frenaticamente hehe</p>
<p><br class="spacer_" /></p>
<p>E neste post irei disponibilizar as respectivas informações da palestra apresentada.</p>
<p><br class="spacer_" /></p>
<p><strong>Post interessante que recomendo a leitura: </strong><a href="http://erichkist.wordpress.com/2010/07/08/resumo-flex-mania-2010-dia-1">Resumo: Flex Mania 2010 – Dia 1</a> (<a href="http://erichkist.wordpress.com/">Erich Kist Blog</a>)</p>
<p><br class="spacer_" /></p>
<p>Aqui também deixo meus agradecimento a todos os presentes na minha palestra \o/ e ao <a href="http://twitter.com/IgorCosta">@IgorCosta</a> (<a href="http://www.igorcosta.com">Site</a>) pelo convite.</p>
<p><br class="spacer_" /></p>
<p>Tem mais na próxima página&#8230;</p>
<p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2059&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/13/flex-air-swiz-framework-meus-primeiros-passos/" title="[Flex &#038; AIR] Swiz Framework &#8211; meus primeiros passos">[Flex &#038; AIR] Swiz Framework &#8211; meus primeiros passos</a></li><li><a href="http://blog.erkobridee.com/2009/11/18/flex-builder-codigo-fonte-derivado-do-eclipse-disponivel/" title="Flex Builder código fonte derivado do Eclipse : disponível">Flex Builder código fonte derivado do Eclipse : disponível</a></li><li><a href="http://blog.erkobridee.com/2009/11/18/flex-builder-parou-de-compilar-bin-release-o-que-fazer/" title="Flex Builder parou de compilar (bin-release), o que fazer?">Flex Builder parou de compilar (bin-release), o que fazer?</a></li><li><a href="http://blog.erkobridee.com/2009/11/16/o-que-e-o-adobe-flex/" title="O que é o Adobe Flex?">O que é o Adobe Flex?</a></li><li><a href="http://blog.erkobridee.com/2009/05/19/java-magazine-68-artigo-sobre-adobe-flex-e-air/" title="Java Magazine 68 : Artigo sobre Adobe Flex e AIR">Java Magazine 68 : Artigo sobre Adobe Flex e AIR</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/07/09/flexmania-2010-adobe-flex-oracle-weblogic-10-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adobe Flex + BlazeDS e um problema de conexão no servidor</title>
		<link>http://blog.erkobridee.com/2010/05/12/adobe-flex-blazeds-e-um-problema-de-conexao-no-servidor/</link>
		<comments>http://blog.erkobridee.com/2010/05/12/adobe-flex-blazeds-e-um-problema-de-conexao-no-servidor/#comments</comments>
		<pubDate>Thu, 13 May 2010 00:51:00 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[KingHost]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2041</guid>
		<description><![CDATA[Neste post irei compartilhar com vocês uma situação que pude acompanhar durante essa semana, onde tinhamos uma aplicação em Adobe Flex, usando Java (BlazeDS), rodava perfeitamente localmente, porém ao enviá-la para o servidor de hospedagem a comunicação nada de funcionar...]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F05%2F12%2Fadobe-flex-blazeds-e-um-problema-de-conexao-no-servidor%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F05%2F12%2Fadobe-flex-blazeds-e-um-problema-de-conexao-no-servidor%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Neste post irei compartilhar com vocês uma situação que pude acompanhar durante essa semana, onde tinhamos uma aplicação em Adobe Flex, usando Java (BlazeDS), rodava perfeitamente localmente, porém ao enviá-la para o servidor de hospedagem a comunicação nada de funcionar&#8230;</p>
<p><br class="spacer_" /></p>
<p>Recebi um email dia 10/05 do <a href="http://twitter.com/feahorita">@feahorita</a> pedindo uma ajuda com um projeto em Adobe Flex com Java, onde tudo ia bem localmente, porém ao tentar publicá-lo no servidor, advinhem&#8230; Murphy marcando presença&#8230; no email ele me descreveu a seguinte mensagem:</p>
<p style="text-align: center;"><em>Erro: Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: &#8216;http://www.meu.domin.io/application/messagebroker/amf&#8217;</em></p>
<p>Seguido da informação que localmente funcionava&#8230;</p>
<p><br class="spacer_" /></p>
<p>Então nisso foram 3 dias trocando emails, onde fui ajudando &#8220;as cegas&#8221; para tentar solucionar o problema, me baseando nos motivos que conheço que podem gerar o problema:</p>
<p style="padding-left: 30px;">- URL errada do caminho no servidor onde foi publicado</p>
<p style="padding-left: 30px;">- crossdmain.xml</p>
<p style="padding-left: 30px;">- algum erro gerado devido a alguma configuração, limitação no servidor onde foi publicado a aplicação</p>
<p><br class="spacer_" /></p>
<p>Depois de executar os testes dos primeiros itens, sem sucesso, restou apenas tentar ver se era alguma configuração no servidor de hospedagem, no caso Apache Tomcat&#8230; e como última hipótese conhecida (ainda bem que era isso), o <a href="http://twitter.com/feahorita">@feahorita</a> entrou em contato com o suporte do seu serviço de hospedagem e eis que o problema foi localizado e para sua felicidade solucionado, o qual, ele compartilhou comigo em um email de agradecimento pela ajuda&#8230;</p>
<p><br class="spacer_" /></p>
<p>Parte do email que ele me contou a solução do problema:</p>
<blockquote><p><br class="spacer_" /></p>
<div id="_mcePaste">Consegui. Eu liguei la para o pessoal do servidor e eles desabilitaram o <strong>mod_Security</strong> do <strong>Apache Tomcat</strong> e funcionou. Realmente era um bloqueio deles lá e não erro nosso aqui.</div>
<p><br class="spacer_" /></p>
</blockquote>
<p><br class="spacer_" /></p>
<p>Então fica ai a dica, caso você também vá publicar a sua aplicação em um serviço de hospedagem Java, com Apache Tomcat lá e se depare com esse tipo de problema, esta pode ser a solução para você também.</p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2041&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/" title="Adobe Flex 3.5 : UploadDownloadBlazeDS">Adobe Flex 3.5 : UploadDownloadBlazeDS</a></li><li><a href="http://blog.erkobridee.com/2008/06/14/construindo-aplicacoes-web-e-desktop-com-blazeds-e-amf/" title="Construindo aplicações Web e Desktop com BlazeDS e AMF">Construindo aplicações Web e Desktop com BlazeDS e AMF</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/" title="Adobe Flash Builder + Flex 4 + BlazeDS 4">Adobe Flash Builder + Flex 4 + BlazeDS 4</a></li><li><a href="http://blog.erkobridee.com/2009/11/28/api-xuggler-edicao-de-video-em-tempo-real/" title="API &#8211; Xuggler : edição de vídeo em tempo real">API &#8211; Xuggler : edição de vídeo em tempo real</a></li><li><a href="http://blog.erkobridee.com/2009/10/26/adobe-flex-httpservice-enviando-parametros-para-a-aplicacao-web-em-java/" title="Adobe Flex (HttpService) enviando parametros para a aplicação web em Java">Adobe Flex (HttpService) enviando parametros para a aplicação web em Java</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/05/12/adobe-flex-blazeds-e-um-problema-de-conexao-no-servidor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebLogic 10.x + Hibernate 3 (JPA) e base Oracle 9+</title>
		<link>http://blog.erkobridee.com/2010/05/03/weblogic-10-x-hibernate-3-jpa-e-base-oracle-9/</link>
		<comments>http://blog.erkobridee.com/2010/05/03/weblogic-10-x-hibernate-3-jpa-e-base-oracle-9/#comments</comments>
		<pubDate>Mon, 03 May 2010 13:13:08 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Banco de Dados]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Datasource]]></category>
		<category><![CDATA[Dica]]></category>
		<category><![CDATA[Hibernate 3]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Weblogic 11g]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2038</guid>
		<description><![CDATA[Semana passada tive um desentendimento com o Oracle WebLogic 10.x, e um projeto onde neste utilizava o Hibernate 3 com JPA para acessar um datasource de acesso a um base Oracle 9+, configurado no WebLogic, depois de muitos testes para resolver o problema, foi bem simples, confira....]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F05%2F03%2Fweblogic-10-x-hibernate-3-jpa-e-base-oracle-9%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F05%2F03%2Fweblogic-10-x-hibernate-3-jpa-e-base-oracle-9%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Semana passada tive um desentendimento com o Oracle WebLogic 10.x, e um projeto onde neste utilizava o Hibernate 3 com JPA para acessar um datasource de acesso a um base Oracle 9+, configurado no WebLogic, depois de muitos testes para resolver o problema, foi bem simples, confira&#8230;.</p>
<p><br class="spacer_" /></p>
<p><strong>Motivo do problema:</strong></p>
<p>O Oracle WebLogic 10.x, possui &#8220;vontade própria&#8221;, porém o correto é dizer que ele possui um fluxo de leitura das libs e prioridades de uso delas em um respectivo domínio, com isto a lib primária de JPA utilizada pelo Oracle WebLogic 10.x é o OpenJPA e com isto começou o drama&#8230; Como dizer ao Oracle WebLogic 10.x para usar o Hibernate 3 e não o OpenJPA&#8230;</p>
<p><br class="spacer_" /></p>
<p><strong>Cenário do problema:</strong></p>
<p>O ambiente de desenvolvimento do projeto é o Eclipse Galigeo, java 1.5+, servidor de execução local Apache Tomcat 6+ e este projeto possui uma interface em Adobe Flex, comunicando-se com o java através do BlazeDS. Onde o servidor de produção é o Oracle WebLogic 10.x.</p>
<p><br class="spacer_" /></p>
<p><strong>Resolvendo o problema:</strong></p>
<p>Para resolver este problema foi necessário fazer alguns ajustes de configuração no projeto, segue os passos:</p>
<p><strong>1 -</strong> criar o arquivo <em>weblogic-application.xml</em> no <em>WEB-INF</em>, onde foi utilizada a configuração abaixo, a qual diz ao Oracle WebLogic 10.x para priorizar o uso das respectivas libs para a aplicação:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2038code1'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20381"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p2038code1"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;weblogic-application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer-application-packages<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;package-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.hibernate.*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/package-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;package-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/package-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;package-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>antlr.*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/package-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer-application-packages<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/weblogic-application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p><strong>2 -</strong> revisar a configuração do /classes/META-INF/<em>persistence.xml</em> para o respectivo modelo descrito abaixo:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2038code2'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20382"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p2038code2"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;persistence</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/persistence&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;persistence-unit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;datasource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;provider<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.hibernate.ejb.HibernatePersistence<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/provider<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.connection.datasource&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc/appName&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.dialect&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;org.hibernate.dialect.Oracle9iDialect&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.default_schema&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;DB_OWNER&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.query.factory_class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;org.hibernate.hql.classic.ClassicQueryTranslatorFactory&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.transaction.manager_lookup_class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;org.hibernate.transaction.WeblogicTransactionManagerLookup&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/persistence-unit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/persistence<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p>a seguir, segue o modelo da classe Java que utilizei para recuperar uma conexão do datasource, para efetuar as manipulações de base de dados utilizando JPA + Hibernate:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2038code3'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20383"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p2038code3"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">br.com.gvt.cdi.dao.hibernate.base</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.persistence.EntityManager</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.persistence.EntityManagerFactory</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.persistence.Persistence</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000000; font-weight: bold;">class</span> DaoBase <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//--------------------------------------------------------------------------</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> PERSISTENCE_UNIT <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;datasource&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//--------------------------------------------------------------------------</span>
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que retorna um gerenciador de entidade instânciado
	 *
	 * @return EntityManager
	 */</span>
	<span style="color: #000000; font-weight: bold;">protected</span> EntityManager getEntityManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">/*
		 *  criando um factory, pegando as configurações de acesso
		 *  a base de dados da aplicação
		 */</span>
		EntityManagerFactory entityManagerFactory <span style="color: #339933;">=</span> Persistence
		.<span style="color: #006633;">createEntityManagerFactory</span><span style="color: #009900;">&#40;</span>PERSISTENCE_UNIT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// retorna a instância do gerenciador de entidades</span>
		<span style="color: #000000; font-weight: bold;">return</span> entityManagerFactory.<span style="color: #006633;">createEntityManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p>Com isto, o projeto finalmente funcionou no Oracle WebLogic 10.x, porém no console ainda não visíveis alguns alertas que dizem que o OpenJPA que é o default do Oracle WebLogic 10.x não está sendo usado. Mas é apenas um alerta, não é necessário se preocupar com esta mensagem.</p>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2038&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/03/08/oracle-weblogic-server-11g-release-1-10-3-2/" title="Oracle WebLogic Server 11g Release 1 (10.3.2)">Oracle WebLogic Server 11g Release 1 (10.3.2)</a></li><li><a href="http://blog.erkobridee.com/2009/10/27/oracle-java-e-um-problema-com-a-url-de-conexao/" title="Oracle, Java e um problema com a URL de conexão">Oracle, Java e um problema com a URL de conexão</a></li><li><a href="http://blog.erkobridee.com/2009/02/21/tomcat-oracle-como-configurar-um-datasource/" title="Tomcat + Oracle: como configurar um datasource">Tomcat + Oracle: como configurar um datasource</a></li><li><a href="http://blog.erkobridee.com/2010/07/09/como-jogar-call-of-dudy-4-mw-em-servidores-do-brasil/" title="Como jogar Call Of Dudy 4 MW em servidores do Brasil?">Como jogar Call Of Dudy 4 MW em servidores do Brasil?</a></li><li><a href="http://blog.erkobridee.com/2010/07/09/flexmania-2010-adobe-flex-oracle-weblogic-10-x/" title="FlexMania 2010 &#8211; Adobe Flex + Oracle WebLogic 10.x">FlexMania 2010 &#8211; Adobe Flex + Oracle WebLogic 10.x</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/05/03/weblogic-10-x-hibernate-3-jpa-e-base-oracle-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe Flash Builder + Flex 4 + BlazeDS 4</title>
		<link>http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/</link>
		<comments>http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 08:39:39 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Projeto]]></category>
		<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Código]]></category>
		<category><![CDATA[Exemplo]]></category>
		<category><![CDATA[Flex 4]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/</guid>
		<description><![CDATA[Post sobre como criar um projeto no novo Adobe Flash Builder 4, de um projeto Flex 4 com BlazeDS 4 e um exemplo de comunicação via Remoting, segue… &#160; Para este post serão necessários os items: - Eclipse Galileo JEE - Adobe Flash Builder 4 plugin - Apache Tomcat 6 - BlazeDS 4 ( versão [...]]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F28%2Fadobe-flash-builder-flex-4-blazeds-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F28%2Fadobe-flash-builder-flex-4-blazeds-4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Post sobre como criar um projeto no novo Adobe Flash Builder 4, de um projeto Flex 4 com BlazeDS 4 e um exemplo de comunicação via Remoting, segue…</p>
<p> <span id="more-2023"></span></p>
<p>&#160;</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/EclipseGalileoWelcome.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="EclipseGalileoWelcome" border="0" alt="EclipseGalileoWelcome" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/EclipseGalileoWelcome_thumb.png" width="404" height="242" /></a> </p>
<p>Para este post serão necessários os items:</p>
<p>- <a href="http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/galileor">Eclipse Galileo JEE</a></p>
<p>- <a href="http://www.adobe.com/products/flex/">Adobe Flash Builder 4 plugin</a></p>
<p>- <a href="http://tomcat.apache.org/download-60.cgi">Apache Tomcat 6</a></p>
<p>- <a href="http://opensource.adobe.com/wiki/display/blazeds/download+blazeds+trunk">BlazeDS 4</a> ( versão Beta utilizada: <strong><em>Nightly Builds > 4.0.0.14910</em></strong> )</p>
<p>&#160;</p>
<p><strong>Criando projeto:</strong></p>
<p>Parar criar o projeto iremos precisar do BlazeDS.war previamente, da versão indicada neste post, então, na perspectiva Flash, iremos criar nosso projeto:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/EclipseGaligeoFlashBuilderPerspective.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="EclipseGaligeoFlashBuilderPerspective" border="0" alt="EclipseGaligeoFlashBuilderPerspective" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/EclipseGaligeoFlashBuilderPerspective_thumb.png" width="404" height="283" /></a></p>
<p>Temos 2 alternativas para criar um novo projeto Flex:</p>
<p>- Através do menu: <strong><em>File > New > Flex Project</em></strong></p>
<p>- Clicar com botão direito, na área em branco do <strong><em>Package Explorer</em></strong>, no popup menu: <strong>New > Flex Project</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectWizard_01.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectWizard_01" border="0" alt="Flex4ProjectWizard_01" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectWizard_01_thumb.png" width="218" height="244" /></a> Nessa primeira tela iremos definir o nome do projeto, indicando que será um projeto Flex, indicando que terá o back-end (lado Java que irá utilizar o BlazeDS) e será um projeto combinando o Flex e o WTP no mesmo projeto, onde o diretório do java será o indicado no campo (no meu caso utilizo como padrão <strong><em>java_src</em></strong> ), configurado o que for necessário, clique no botão <strong>Next ></strong></p>
<p>&#160;<a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectWizard_02.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectWizard_02" border="0" alt="Flex4ProjectWizard_02" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectWizard_02_thumb.png" width="218" height="244" /></a> Nessa tela é importante observar, uma dica que irá lhe poucar horas de dor de cabeça, nos campos: <strong><em>Context root</em></strong> e <strong><em>Context folder</em></strong> obrigatoriamente devem ter o mesmo nome, para que na hora da execução funcione sem necessidade de nenhuma configuração adicional.</p>
<blockquote><p>Porém a parte ruim disto é, para quem cria, e/ou, já criou projetos Java Web no Eclipse JEE está acostumado com os projetos onde o diretório onde ficam o conteúdo de páginas é o <strong>/WebContent</strong>, então nesse projeto esse diretório será o nome definido no <strong><em>Context folder</em></strong></p>
</blockquote>
<p>Lembrando também que nessa tela você deverá indicar o locar do BlazeDS.war, que será usado na geração da estrutura do seu projeto.</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectWizard_03.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectWizard_03" border="0" alt="Flex4ProjectWizard_03" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectWizard_03_thumb.png" width="215" height="244" /></a> Último passo da criação do projeto, aqui, eu por padrão defino:</p>
<p>- Framework linkage: <strong><em>Runtime shared library (RSL)</em></strong></p>
<p>- Main application file: <strong><em>index.mxml</em></strong></p>
<p>Depois basta clicar no botão </p>
<p>&#160;</p>
<p>Com isso temos o projeto criado:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView" border="0" alt="Flex4ProjectView" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_thumb.png" width="244" height="118" /></a> Como comentado anteriormente, podemos ver que o diretório web, ao invés do tradicional <strong>/WebContent</strong> temos o diretório nesse exemplo: <strong>/helloworld</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_02.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_02" border="0" alt="Flex4ProjectView_02" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_02_thumb.png" width="179" height="188" /></a> Mas nem tudo são flores… agora que temos o projeto pronto, precisamos fazer alguns ajustes, os famosos <em>ajustes finos</em>…</p>
<p>&#160;</p>
<p><strong>Configurando o BlazeDS:</strong></p>
<p>Primerio, vamos começar removendo os <em>lixos</em> (o que não iremos utilizar) no BlazeDS do projeto. Iremos começar removendo os itens:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_03.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_03" border="0" alt="Flex4ProjectView_03" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_03_thumb.png" width="179" height="188" /></a> Feito isso, iremos remover as bibliotecas (diretório <strong>/lib</strong>) do Spring que não serão utilizadas:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_04.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_04" border="0" alt="Flex4ProjectView_04" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_04_thumb.png" width="366" height="545" /></a></p>
<p>Ficando apenas:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_05.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_05" border="0" alt="Flex4ProjectView_05" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_05_thumb.png" width="224" height="221" /></a>Outra configuração que normalmente faço nos projetos, para evitar problemas quando trabalho com vários desenvolvedores em equipes é na configuração das propriedades do projeto onde indica o local do <em><strong>services-config.xml</strong></em> e me certifico que o <strong><em>locale</em></strong> esteja em <em>en_US</em>, o que me evita algumas dores de cabeça.</p>
<p>Para isto, clique com botão direito do mouse sobre o projeto:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_06.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_06" border="0" alt="Flex4ProjectView_06" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_06_thumb.png" width="461" height="639" /></a>Clique na opção <strong>Properties</strong> do popup menu. Com isso irá abrir uma janela com as propriedades. Nessa janela selecione o item:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_07.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_07" border="0" alt="Flex4ProjectView_07" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_07_thumb.png" width="160" height="136" /></a> Então nessa tela configure o item:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_08.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_08" border="0" alt="Flex4ProjectView_08" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_08_thumb.png" width="211" height="244" /></a> Additional compiler arguments:     <br /><em>-services &quot;../helloworld/WEB-INF/flex/services-config.xml&quot; -locale en_US</em></p>
<p>Feito isso, clique no botão <strong>OK</strong></p>
<p>&#160;</p>
<p>Para finalizar os ajustes finos ainda é necessário atualizar o <strong><em>web.xml </em></strong>da aplicação, pelo que está dentro do <strong>BlazeDS.war</strong> que foi utilizado para criar o projeto, pois de alguma forma o Wizard de criação do projeto gera um outro conteúdo para o <strong><em>web.xml</em></strong>.</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_09.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_09" border="0" alt="Flex4ProjectView_09" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_09_thumb.png" width="126" height="150" /></a> Segue o conteúdo atualizado do <strong><em>web.xml</em></strong></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2023code9'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20239"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code" id="p2023code9"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE web-app PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot; &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>HelloWorld<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>BlazeDS Application<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Http Flex Session attribute and binding listener support --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>flex.messaging.HttpFlexSession<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- MessageBroker Servlet --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>MessageBrokerServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>MessageBrokerServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>flex.messaging.MessageBrokerServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>services.configuration.file<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/WEB-INF/flex/services-config.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- é importante que esteja descomentado --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RDSDispatchServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RDSDispatchServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>flex.rds.server.servlet.FrontEndServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>useAppserverSecurity<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			 <span style="color: #808080; font-style: italic;">&lt;!-- como não iremos utilizar autenticação --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;RDS_DISPATCH_MAPPING&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RDSDispatchServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/CFIDE/main/ide.cfm<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>MessageBrokerServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/messagebroker/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file-list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.htm<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file-list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Agora vamos colocar a mão na massa e fazer o que interessa… Como vou apenas mostrar como utilizar Remote Object, irei fazer uma comunicação bem simples entre o Flex e o Java…</p>
<p>&#160;</p>
<p>Segue a classe Java do serviço:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2023code10'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p202310"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code" id="p2023code10"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.erkobridee.helloworld.flex.service</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author Erko
 * @description Classe de serviço
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloWorld <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sayHello<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;Hello Flex 4 o/&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sayHelloTo<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Hello, &quot;</span> <span style="color: #339933;">+</span> name<span style="color: #339933;">;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> message<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Agora precisamos cadastrar essa nossa classe como um serviço disponível no BlazeDS, e isto deverá ser feito no arquivo: <strong><em>remoting-config.xml</em></strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_10.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_10" border="0" alt="Flex4ProjectView_10" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_10_thumb.png" width="227" height="240" /></a> Segue a configuração do serviço:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2023code11'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p202311"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p2023code11"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;helloWorldService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.erkobridee.helloworld.flex.service.HelloWorld<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destination<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Até aqui já temos o lado do servidor pronto, hora de ir para o lado Flex da aplicação…</p>
<p>&#160;</p>
<p>Nessa nova versão do Flex existem 2 maneiras de trabalhar com os Remote Objects, a forma antiga que estamos acostumados através das mesmas tags do Flex 3 <em><mx:RemoteObject></em> ou através dos <em>Data Wizard</em> presente no <strong><em>Adobe Flash Builder</em></strong> que gera para nós um suporte para trrabalhar com os Remote Objects…</p>
<p>&#160;</p>
<p>Mas vamos começar definindo a interface da aplicação:</p>
<p>&#160;<a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_11.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Flex4ProjectView_11" border="0" alt="Flex4ProjectView_11" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_11_thumb.png" width="532" height="170" /></a> </p>
<p>Irei começar pela forma antiga, codificando como era feito no Flex 3, mas algo que não posso deixar de comentar aqui, utilizando o Adobe Flash Builder 4, a produtividade de velocidade de codificação estão muito mais rápidos do que na versão do Adobe Flex Builder 3…</p>
</p>
<p>Comentei o panel do Data Wizard e implementei os respectivos códigos para execução, conforme o código a seguir:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2023code12'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p202312"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
</pre></td><td class="code" id="p2023code12"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Application xmlns<span style="color: #000066; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
			   xmlns<span style="color: #000066; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
			   xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/mx&quot;</span> minWidth=<span style="color: #990000;">&quot;955&quot;</span> minHeight=<span style="color: #990000;">&quot;600&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> ___________________________________________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Alert<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>FaultEvent<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ResultEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// Handlers Remote Object formato antigo</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> roService_faultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>FaultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>fault<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">message</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> roService_sayHello_ResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> roService_sayHelloTo_ResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>			
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// evento de click nos botões : Remote Object formato antigo</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloBtnRO_clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>roService<span style="color: #000066; font-weight: bold;">.</span>sayHello<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloToNameBtnRO_clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>roService<span style="color: #000066; font-weight: bold;">.</span>sayHelloTo<span style="color: #000000;">&#40;</span>nameFieldRO<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> ___________________________________________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Declarations<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!--</span> Place non<span style="color: #000066; font-weight: bold;">-</span>visual <span style="color: #004993;">elements</span> <span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span>g<span style="color: #000066; font-weight: bold;">.,</span> services<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">value</span> objects<span style="color: #000000;">&#41;</span> here <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>RemoteObject
			id=<span style="color: #990000;">&quot;roService&quot;</span>
			destination=<span style="color: #990000;">&quot;helloWorldService&quot;</span>
			fault=<span style="color: #990000;">&quot;roService_faultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;!--</span> esse formato é útil quando se tem um tipo de resultado para cada método <span style="color: #000066; font-weight: bold;">--&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">method</span> <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;sayHello&quot;</span> result=<span style="color: #990000;">&quot;roService_sayHello_ResultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">method</span> <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;sayHelloTo&quot;</span> result=<span style="color: #990000;">&quot;roService_sayHelloTo_ResultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>RemoteObject<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Declarations<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> ___________________________________________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;250&quot;</span> title=<span style="color: #990000;">&quot;&lt;mx:RemoteObject&gt;&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem label=<span style="color: #990000;">&quot;Name&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
					<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>TextInput id=<span style="color: #990000;">&quot;nameFieldRO&quot;</span> <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Remote Object&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHello&quot;</span> id=<span style="color: #990000;">&quot;sayHelloBtnRO&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;sayHelloBtnRO_clickHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHelloToName&quot;</span> id=<span style="color: #990000;">&quot;sayHelloToNameBtnRO&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;sayHelloToNameBtnRO_clickHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> Por enquanto não foi implementado <span style="color: #004993;">os</span> <span style="color: #004993;">c</span>ódigos dessa parte
	<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;268&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;250&quot;</span> title=<span style="color: #990000;">&quot;Data Wizard&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem label=<span style="color: #990000;">&quot;Name&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
					<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>TextInput id=<span style="color: #990000;">&quot;nameFieldDW&quot;</span> <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Data Wizard&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHello&quot;</span> id=<span style="color: #990000;">&quot;sayHelloBtnDW&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHelloToName&quot;</span> id=<span style="color: #990000;">&quot;sayHelloToNameBtnDW&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Application<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Hora de testar… para isso clique com botão direito do mouse sobre o projeto e selecione a opção:<strong><em>&#160; Run as > Run on Server</em></strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_12.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_12" border="0" alt="Flex4ProjectView_12" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_12_thumb.png" width="244" height="166" /></a></p>
<p>Na janela a seguir, assumindo que você tenha baixado o Apache Tomcat 6, e que esteja disponível no seu ambiente e que não tenha nenhum outro projeto vinculado…</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_13.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Flex4ProjectView_13" border="0" alt="Flex4ProjectView_13" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_13_thumb.png" width="529" height="677" /></a></p>
<p>clique no botão <strong>Finish</strong></p>
<p>&#160;</p>
<p>Com isso basta abrir a aplicação no WebBrowser: </p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_14.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_14" border="0" alt="Flex4ProjectView_14" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_14_thumb.png" width="528" height="253" /></a></p>
<p>Clicando no botão <strong>sayHello</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_15.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_15" border="0" alt="Flex4ProjectView_15" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_15_thumb.png" width="528" height="253" /></a> </p>
<p>Clicando no botão <strong>sayHelloToName</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_16.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_16" border="0" alt="Flex4ProjectView_16" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_16_thumb.png" width="528" height="253" /></a> </p>
<p>&#160;</p>
<p>Vimos que a códificação é exatamente a mesma que estamos acostumados, pelo menos as tags, fora a sintaxe, organização do MXML do Flex 4 ficou mais clara (pelo menos na minha opinião).</p>
<p>&#160;</p>
<p>Hora de vermos a outra forma de trabalhar, que é através do Data Wizard… </p>
<blockquote>
<p>Lembre-se de deixar o servidor executando…</p>
</blockquote>
<p>&#160;</p>
<p>Clique na aba<strong> Data/Services</strong> do Adobe Flash Builder</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_17.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_17" border="0" alt="Flex4ProjectView_17" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_17_thumb.png" width="353" height="156" /></a> Nessa aba, clique no link <strong><em>Connect to Data/Service…</em></strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_18.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_18" border="0" alt="Flex4ProjectView_18" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_18_thumb.png" width="470" height="451" /></a> Nessa janela que será aberta, selecione <strong><em>BlazeDS</em></strong> e clique no botão <strong>Next ></strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_19.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_19" border="0" alt="Flex4ProjectView_19" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_19_thumb.png" width="536" height="254" /></a> </p>
<p>Irá lhe aparecer esta janela, solicitando o usuário e senha. Lembrando que configuramos sem autenticação, selecione o check box <em>No password required</em> e clique no botão <strong>OK</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_20.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_20" border="0" alt="Flex4ProjectView_20" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_20_thumb.png" width="470" height="451" /></a>Nessa janela serão exibidos todos os serviços disponíves pelo BlazeDS, então selecione o respectivo serviço (<em>Destination</em>), indique o pacote <strong><em>Service package</em></strong> que será o pacote onde serão gerados os códigos AS3 para uso do serviço. Feito isso, clique no botão <strong>Finish</strong>&#160;</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_21.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_21" border="0" alt="Flex4ProjectView_21" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_21_thumb.png" width="290" height="156" /></a> Na aba <strong><em>Data/Services</em></strong> , agora você ve o seu serviço mapeado disponível…</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_22.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_22" border="0" alt="Flex4ProjectView_22" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_22_thumb.png" width="375" height="292" /></a></p>
<p>O Adobe Flash Builder também te disponibiliza um meio fácil e rápido para testar o seu serviço… Basta indicar qual serviço e respectiva operação que deseja efetuar o teste.</p>
<p>&#160;</p>
<p>Bom agora que já temos o suporte, basta adicionar o código de uso na nossa aplicação… e com esse novo Adobe Flash Builder é realmente muito simples de fazer isso</p>
<p align="center"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_23.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_23" border="0" alt="Flex4ProjectView_23" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_23_thumb.png" width="541" height="230" /></a> Uma maneira de fazer isto é, na área de desenvolvimento visual, selecionar o item, no caso o botão <strong><em>sayHello</em></strong> ir na paleta de propriedades e na definição do <em>On click</em>, clicar no item indicado em vermelho, então selecionar o <em>Generate Service Call</em></p>
<p align="center"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_24.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_24" border="0" alt="Flex4ProjectView_24" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_24_thumb.png" width="339" height="205" /></a> </p>
<p>Será aberto uma janela, onde você deverá indicar qual serviço e respectiva operação que será executada, feito isso clique no botão <strong>OK</strong></p>
<p>&#160;</p>
<p>Bom para o outro botão basta realizar o mesmo procedimento, indicando a operação <strong><em>sayHelloTo</em></strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_25.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Flex4ProjectView_25" border="0" alt="Flex4ProjectView_25" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_25_thumb.png" width="339" height="205" /></a> </p>
<p>Com isso o código da aplicação Flex ficou:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2023code13'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p202313"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
</pre></td><td class="code" id="p2023code13"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Application xmlns<span style="color: #000066; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
			   xmlns<span style="color: #000066; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
			   xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/mx&quot;</span> minWidth=<span style="color: #990000;">&quot;955&quot;</span> minHeight=<span style="color: #990000;">&quot;600&quot;</span> xmlns<span style="color: #000066; font-weight: bold;">:</span>service=<span style="color: #990000;">&quot;service.*&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> ___________________________________________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Alert<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>FaultEvent<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ResultEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// Handlers Remote Object formato antigo</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> roService_faultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>FaultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>fault<span style="color: #000066; font-weight: bold;">.</span>faultString <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">'<span style="">\n</span>'</span> <span style="color: #000066; font-weight: bold;">+</span> event<span style="color: #000066; font-weight: bold;">.</span>fault<span style="color: #000066; font-weight: bold;">.</span>faultDetail<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> roService_sayHello_ResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> roService_sayHelloTo_ResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>			
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// evento de click nos botões : Remote Object formato antigo</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloBtnRO_clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>roService<span style="color: #000066; font-weight: bold;">.</span>sayHello<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloToNameBtnRO_clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>roService<span style="color: #000066; font-weight: bold;">.</span>sayHelloTo<span style="color: #000000;">&#40;</span>nameFieldRO<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//============================================================================================</span>
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// Handlers Data Wizard formato novo</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> helloWorldService_faultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>FaultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>fault<span style="color: #000066; font-weight: bold;">.</span>faultString <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">'<span style="">\n</span>'</span> <span style="color: #000066; font-weight: bold;">+</span> event<span style="color: #000066; font-weight: bold;">.</span>fault<span style="color: #000066; font-weight: bold;">.</span>faultDetail<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>			
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloResult_resultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>			
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloToResult_resultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>			
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// evento de click nos botões : Data Wizard formato novo</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloBtnDW_clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				sayHelloResult<span style="color: #000066; font-weight: bold;">.</span>token = helloWorldService<span style="color: #000066; font-weight: bold;">.</span>sayHello<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>		
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> sayHelloToNameBtnDW_clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
			<span style="color: #000000;">&#123;</span>
				sayHelloToResult<span style="color: #000066; font-weight: bold;">.</span>token = helloWorldService<span style="color: #000066; font-weight: bold;">.</span>sayHelloTo<span style="color: #000000;">&#40;</span>nameFieldDW<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> ___________________________________________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Declarations<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!--</span> Place non<span style="color: #000066; font-weight: bold;">-</span>visual <span style="color: #004993;">elements</span> <span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span>g<span style="color: #000066; font-weight: bold;">.,</span> services<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">value</span> objects<span style="color: #000000;">&#41;</span> here <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>RemoteObject
			id=<span style="color: #990000;">&quot;roService&quot;</span>
			destination=<span style="color: #990000;">&quot;helloWorldService&quot;</span>
			fault=<span style="color: #990000;">&quot;roService_faultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;!--</span> esse formato é útil quando se tem um tipo de resultado para cada método <span style="color: #000066; font-weight: bold;">--&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">method</span> <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;sayHello&quot;</span> result=<span style="color: #990000;">&quot;roService_sayHello_ResultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">method</span> <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;sayHelloTo&quot;</span> result=<span style="color: #990000;">&quot;roService_sayHelloTo_ResultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>RemoteObject<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;!--</span> __________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;!--</span> equivalente ao s<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">method</span> sayHello <span style="color: #000066; font-weight: bold;">--&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>CallResponder id=<span style="color: #990000;">&quot;sayHelloResult&quot;</span> result=<span style="color: #990000;">&quot;sayHelloResult_resultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;!--</span> equivalente ao s<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">method</span> sayHelloTo <span style="color: #000066; font-weight: bold;">--&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>CallResponder id=<span style="color: #990000;">&quot;sayHelloToResult&quot;</span> result=<span style="color: #990000;">&quot;sayHelloToResult_resultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;!--</span> equivalente ao s<span style="color: #000066; font-weight: bold;">:</span>RemoteObject roService <span style="color: #000066; font-weight: bold;">--&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>service<span style="color: #000066; font-weight: bold;">:</span>HelloWorldService
			id=<span style="color: #990000;">&quot;helloWorldService&quot;</span>
			fault=<span style="color: #990000;">&quot;helloWorldService_faultHandler(event)&quot;</span>
			showBusyCursor=<span style="color: #990000;">&quot;true&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Declarations<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;!--</span> ___________________________________________________________________ <span style="color: #000066; font-weight: bold;">--&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;250&quot;</span> title=<span style="color: #990000;">&quot;&lt;mx:RemoteObject&gt;&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem label=<span style="color: #990000;">&quot;Name&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
					<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>TextInput id=<span style="color: #990000;">&quot;nameFieldRO&quot;</span> <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Remote Object&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHello&quot;</span> id=<span style="color: #990000;">&quot;sayHelloBtnRO&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;sayHelloBtnRO_clickHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHelloToName&quot;</span> id=<span style="color: #990000;">&quot;sayHelloToNameBtnRO&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;sayHelloToNameBtnRO_clickHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;268&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;250&quot;</span> title=<span style="color: #990000;">&quot;Data Wizard&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem label=<span style="color: #990000;">&quot;Name&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
					<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>TextInput id=<span style="color: #990000;">&quot;nameFieldDW&quot;</span> <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Data Wizard&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Form<span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHello&quot;</span> id=<span style="color: #990000;">&quot;sayHelloBtnDW&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;sayHelloBtnDW_clickHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;sayHelloToName&quot;</span> id=<span style="color: #990000;">&quot;sayHelloToNameBtnDW&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;sayHelloToNameBtnDW_clickHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>HGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>VGroup<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Panel<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>Application<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Então executando a aplicação pelo Web Browser temos:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_26.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_26" border="0" alt="Flex4ProjectView_26" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_26_thumb.png" width="545" height="253" /></a> </p>
<p>Clicando no botão <strong>sayHello</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_27.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_27" border="0" alt="Flex4ProjectView_27" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_27_thumb.png" width="545" height="253" /></a> </p>
<p>Clicando no botão <strong>sayHelloTo</strong></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_28.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Flex4ProjectView_28" border="0" alt="Flex4ProjectView_28" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/Flex4ProjectView_28_thumb.png" width="545" height="253" /></a> </p>
<p>&#160;</p>
<p>E com isso finalizo este post.</p>
<p>&#160;</p>
<p><strong>Projeto para download:</strong> [<a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/FlashBuilderFlex4_HelloWorld.zip">HelloWorld</a>] – projeto Adobe Flash Builder 4</p>
<blockquote>
<p>O projeto está sem as libs, necessário realizar o download da versão indicada do BlazeDS e adicionar as libs no projeto.</p>
</blockquote>
<p><strong>Obs.:</strong> Essa maneira de montar projeto é apenas 1 de 3 que eu conheço, porém até o momento é a a mais rápida.</p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2023&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/24/adobe-air-2-nativeprocess-java-simpleairjava/" title="[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava">[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava</a></li><li><a href="http://blog.erkobridee.com/2010/07/18/flex-air-swiz-framework-presentation-model-exemplo-de-projeto/" title="[Flex &#038; AIR] Swiz Framework + Presentation Model : Exemplo de Projeto">[Flex &#038; AIR] Swiz Framework + Presentation Model : Exemplo de Projeto</a></li><li><a href="http://blog.erkobridee.com/2010/03/27/actionscript-3-flash-player-10-localfilehelper/" title="ActionScript 3 + Flash Player 10+ : LocalFileHelper">ActionScript 3 + Flash Player 10+ : LocalFileHelper</a></li><li><a href="http://blog.erkobridee.com/2009/10/26/adobe-flex-httpservice-enviando-parametros-para-a-aplicacao-web-em-java/" title="Adobe Flex (HttpService) enviando parametros para a aplicação web em Java">Adobe Flex (HttpService) enviando parametros para a aplicação web em Java</a></li><li><a href="http://blog.erkobridee.com/2010/07/22/adobe-air-2-nativeprocess-projeto-de-exemplo-windows-console/" title="[Adobe AIR 2 : NativeProcess] projeto de exemplo : Windows Console">[Adobe AIR 2 : NativeProcess] projeto de exemplo : Windows Console</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Adobe Flex 3.5 : UploadDownloadBlazeDS</title>
		<link>http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/</link>
		<comments>http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 04:00:31 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Portifólio]]></category>
		<category><![CDATA[Adobe Flash Player 10]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Arquivos]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[RemoteObject]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/</guid>
		<description><![CDATA[Publicando mais uma dica, algo que uso em alguns projetos, transferir arquivos entre a aplicação Adobe Flex e o Servidor, nesse caso Java (BlazeDS), segue… Eia a interface da aplicação com a implementação da funcionalidade: Para essa implementação foi utilizado: - Adobe Flex Builder 3 (instalado o plugin no Eclipse Ganymede JEE) - Adobe Flex [...]]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F28%2Fadobe-flex-3-5-uploaddownloadblazeds%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F28%2Fadobe-flex-3-5-uploaddownloadblazeds%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Publicando mais uma dica, algo que uso em alguns projetos, transferir arquivos entre a aplicação Adobe Flex e o Servidor, nesse caso Java (BlazeDS), segue…</p>
<p> <span id="more-1941"></span></p>
<p>Eia a interface da aplicação com a implementação da funcionalidade:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/UploadDownloadBlazeDS_layout.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="UploadDownloadBlazeDS_layout" border="0" alt="UploadDownloadBlazeDS_layout" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/UploadDownloadBlazeDS_layout_thumb.png" width="519" height="428" /></a></p>
<p>Para essa implementação foi utilizado:</p>
<p><strong>- Adobe Flex Builder 3 (<em>instalado o plugin no Eclipse Ganymede JEE</em>)</strong></p>
<p><strong>- Adobe Flex 3.5 SDK</strong></p>
<p><strong>- Adobe Flash Player 10+</strong></p>
<p><strong>- BlazeDS 3</strong>&#160;</p>
<p><strong>- Java 1.5+</strong></p>
<p><strong>- Apache Tomcat 6+</strong></p>
<p>&#160;</p>
<p>Estrutura do projeto:</p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/UploadDownloadBlazeDS_Projeto.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="UploadDownloadBlazeDS_Projeto" border="0" alt="UploadDownloadBlazeDS_Projeto" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/UploadDownloadBlazeDS_Projeto_thumb.png" width="212" height="277" /></a> </p>
<blockquote><p>Observe que dentro de WebContent, criei o diretório <strong>files_dir</strong>, para receber os arquivos e a partir deste diretório listar e efetuar o download dos arquivos, para este exemplo.</p>
</blockquote>
<p>&#160;</p>
<p><strong>Funcionalidades implementadas do projeto:</strong></p>
<p>- Upload de um arquivo</p>
<p>- Listagem dos arquivos no diretório de arquivos da aplicação</p>
<p>- Download de um arquivo especificado</p>
<p>- Apagar um arquivo especificado</p>
<p>Segue o código da classe Java que implementa as funcionalidades:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1941code18'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p194118"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
</pre></td><td class="code" id="p1941code18"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.erkobridee.blazeds.util</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileInputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileNotFoundException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileOutputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.ByteBuffer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.channels.FileChannel</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">flex.messaging.FlexContext</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author Erko Bridee
 * @description Classe de gerenciamento de arquivos
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FileUtils <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> dirPath <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;files_dir&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método para receber um arquivo
	 *
	 * @param bytes byte[]
	 * @param fileName String
	 * @return String
	 * @throws Exception
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>  doUpload<span style="color: #009900;">&#40;</span>
			<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> bytes, <span style="color: #666666; font-style: italic;">// bytes do arquivo</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> fileName <span style="color: #666666; font-style: italic;">// nome do arquivo</span>
	<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> <span style="color: #009900;">&#123;</span>
		fileName <span style="color: #339933;">=</span> FlexContext.<span style="color: #006633;">getServletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRealPath</span><span style="color: #009900;">&#40;</span>dirPath <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">+</span> fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;doUpload: &quot;</span> <span style="color: #339933;">+</span> fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a> f <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileoutputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileOutputStream</span></a> fos <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileoutputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileOutputStream</span></a><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		fos.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>bytes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		fos.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;success&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Retorna a listagem dos arquivos disponíveis
	 *
	 * @return List&lt;FileInfo&gt;
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>FileInfo<span style="color: #339933;">&gt;</span> getDownloadList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> <span style="color: #009900;">&#123;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>FlexContext.<span style="color: #006633;">getServletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRealPath</span><span style="color: #009900;">&#40;</span>dirPath<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a> dir <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>FlexContext.<span style="color: #006633;">getServletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRealPath</span><span style="color: #009900;">&#40;</span>dirPath<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> files <span style="color: #339933;">=</span> dir.<span style="color: #006633;">listFiles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		List<span style="color: #339933;">&lt;</span>FileInfo<span style="color: #339933;">&gt;</span> dirList <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>FileInfo<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>files <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// caso o diretório não exista ou o caminho seja um diretório</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>files.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				FileInfo info <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FileInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				info.<span style="color: #006633;">setName</span><span style="color: #009900;">&#40;</span> files<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				info.<span style="color: #006633;">setLength</span><span style="color: #009900;">&#40;</span> files<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				dirList.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span> info <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> dirList<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que recupera um arquivo e retorna seus bytes
	 *
	 * @param fileName
	 * @return byte[]
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> doDownload<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> fileName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;doDownload: &quot;</span> <span style="color: #339933;">+</span> fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a> fis<span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> data <span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		FileChannel fc<span style="color: #339933;">;</span> 
&nbsp;
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			fileName <span style="color: #339933;">=</span> FlexContext.<span style="color: #006633;">getServletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRealPath</span><span style="color: #009900;">&#40;</span>dirPath <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">+</span> fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			fis <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afileinputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileInputStream</span></a><span style="color: #009900;">&#40;</span>fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			fc <span style="color: #339933;">=</span> fis.<span style="color: #006633;">getChannel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			data <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>fc.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			ByteBuffer bb <span style="color: #339933;">=</span> ByteBuffer.<span style="color: #006633;">wrap</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			fc.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>bb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afilenotfoundexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">FileNotFoundException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// TODO</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IOException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// TODO</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> data<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>	
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método para apagar um determinado arquivo
	 *
	 * @param filename String
	 * @return String
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> doDelete<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> fileName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;fail&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		fileName <span style="color: #339933;">=</span> FlexContext.<span style="color: #006633;">getServletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRealPath</span><span style="color: #009900;">&#40;</span>dirPath <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">+</span> fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;doDelete: &quot;</span> <span style="color: #339933;">+</span> fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a> file <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">File</span></a><span style="color: #009900;">&#40;</span>fileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> file.<span style="color: #006633;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> file.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;success&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> 
&nbsp;
		<span style="color: #000000; font-weight: bold;">return</span> message<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Essa classe é mapeada como um serviço do BlazeDS no arquivo <strong>/WebContent/WEB-INF/flex/remoting-config.xml<em> :</em></strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1941code19'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p194119"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1941code19"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;fileUtilService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.erkobridee.blazeds.util.FileUtils<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destination<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>&#160;</p>
<p>No lado da aplicação Flex, foram definidos 2 componetes.</p>
<p>&#160;</p>
<p><strong>Upload:</strong></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1941code20'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p194120"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
</pre></td><td class="code" id="p1941code20"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Panel
	xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
	layout=<span style="color: #990000;">&quot;vertical&quot;</span>
	<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span>  <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span>
	title=<span style="color: #990000;">&quot;Upload : Arquivos&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> vo<span style="color: #000066; font-weight: bold;">.</span>FileInfo<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Alert<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>AsyncToken<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>FaultEvent<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ResultEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> refUploadFile<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=filereference%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:filereference.html"><span style="color: #004993;">FileReference</span></a><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> UploadFiles<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #3f5fbf;">/*
				Chamado para adicionar os arquivos para upload
			*/</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> addFiles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> FILE_FILTER_ALL_FILES_TYPE<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a> = <span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=filefilter%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:filefilter.html"><span style="color: #004993;">FileFilter</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;All files&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;*.*&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				refUploadFile = <span style="color: #0033ff; font-weight: bold;">new</span>  <a href="http://www.google.com/search?q=filereference%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:filereference.html"><span style="color: #004993;">FileReference</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	  			refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">browse</span><span style="color: #000000;">&#40;</span>FILE_FILTER_ALL_FILES_TYPE<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	  			refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">SELECT</span><span style="color: #000066; font-weight: bold;">,</span>onFileSelect<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	  			refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">COMPLETE</span><span style="color: #000066; font-weight: bold;">,</span>onFileComplete<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	  			refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=ioerrorevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:ioerrorevent.html"><span style="color: #004993;">IOErrorEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">IO_ERROR</span><span style="color: #000066; font-weight: bold;">,</span> frIOError<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    			refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=securityerrorevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:securityerrorevent.html"><span style="color: #004993;">SecurityErrorEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">SECURITY_ERROR</span><span style="color: #000066; font-weight: bold;">,</span> frSecError<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #3f5fbf;">/*
				Chamado quando os arquivos são selecionado
			*/</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFileSelect<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
				UploadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>
					<span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">:</span>refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">,</span>
					<span style="color: #004993;">size</span><span style="color: #000066; font-weight: bold;">:</span>FileInfo<span style="color: #000066; font-weight: bold;">.</span>formatFileSize<span style="color: #000000;">&#40;</span>refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">size</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span>
					<span style="color: #004993;">status</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #990000;">&quot;inicial&quot;</span>
				<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider  = UploadFiles<span style="color: #000066; font-weight: bold;">;</span>
				listFiles<span style="color: #000066; font-weight: bold;">.</span>selectedIndex = UploadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">try</span> <span style="color: #000000;">&#123;</span>
					refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">catch</span><span style="color: #000000;">&#40;</span> err<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=ioerrorevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:ioerrorevent.html"><span style="color: #004993;">IOErrorEvent</span></a> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;erro&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #000000;">&#125;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span>  UploadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> == refUploadFile <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">status</span> = <span style="color: #990000;">&quot;carregado&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
						listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider  = UploadFiles<span style="color: #000066; font-weight: bold;">;</span>
						<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #3f5fbf;">/*
				Chamado quando for formatar a representação do tamanho do arquivo
			*/</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> formatFileSize<span style="color: #000000;">&#40;</span>numSize<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> strReturn<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span>
				numSize = <a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000000;">&#40;</span>numSize <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				strReturn = <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#40;</span>numSize<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toFixed</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot; KB&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>numSize <span style="color: #000066; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					numSize = numSize <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000066; font-weight: bold;">;</span>
					strReturn = <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#40;</span>numSize<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toFixed</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot; MB&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>numSize <span style="color: #000066; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						numSize = numSize <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000066; font-weight: bold;">;</span>
						strReturn = <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#40;</span>numSize<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toFixed</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot; GB&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
				<span style="color: #0033ff; font-weight: bold;">return</span> strReturn<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFileComplete<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
				refUploadFile = event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span> <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=filereference%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:filereference.html"><span style="color: #004993;">FileReference</span></a><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=bytearray%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bytearray.html"><span style="color: #004993;">ByteArray</span></a> = refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>  
&nbsp;
				<span style="color: #6699cc; font-weight: bold;">var</span> token<span style="color: #000066; font-weight: bold;">:</span>AsyncToken = AsyncToken<span style="color: #000000;">&#40;</span>
					remoteUpload<span style="color: #000066; font-weight: bold;">.</span>doUpload<span style="color: #000000;">&#40;</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">,</span> refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				token<span style="color: #000066; font-weight: bold;">.</span>kind = refUploadFile<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span>  UploadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> == refUploadFile <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">status</span> = <span style="color: #990000;">&quot;enviando&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
						listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider  = UploadFiles<span style="color: #000066; font-weight: bold;">;</span>
						<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
	  		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> uploadResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span>  UploadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> == event<span style="color: #000066; font-weight: bold;">.</span>token<span style="color: #000066; font-weight: bold;">.</span>kind <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">status</span> = <span style="color: #990000;">&quot;OK&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
						listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider  = UploadFiles<span style="color: #000066; font-weight: bold;">;</span>
						<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
	  		<span style="color: #000000;">&#125;</span>
&nbsp;
	  		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> faultResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>FaultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span>  UploadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> == event<span style="color: #000066; font-weight: bold;">.</span>token<span style="color: #000066; font-weight: bold;">.</span>kind <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						UploadFiles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">status</span> = <span style="color: #990000;">&quot;erro&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
						listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider  = UploadFiles<span style="color: #000066; font-weight: bold;">;</span>
						<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
	  		<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> frIOError<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=ioerrorevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:ioerrorevent.html"><span style="color: #004993;">IOErrorEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
			    Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> frSecError<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=securityerrorevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:securityerrorevent.html"><span style="color: #004993;">SecurityErrorEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
			    Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> clearUploadList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				UploadFiles = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span>
				UploadFiles = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider = UploadFiles<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>RemoteObject
		id=<span style="color: #990000;">&quot;remoteUpload&quot;</span>
		destination=<span style="color: #990000;">&quot;fileUtilService&quot;</span>
		result=<span style="color: #990000;">&quot;uploadResultHandler(event)&quot;</span>
		fault=<span style="color: #990000;">&quot;faultResultHandler(event)&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Canvas <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGrid id=<span style="color: #990000;">&quot;listFiles&quot;</span> <span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">bottom</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;0&quot;</span>
			allowMultipleSelection=<span style="color: #990000;">&quot;true&quot;</span> verticalScrollPolicy=<span style="color: #990000;">&quot;on&quot;</span>
			draggableColumns=<span style="color: #990000;">&quot;false&quot;</span> resizableColumns=<span style="color: #990000;">&quot;false&quot;</span> sortableColumns=<span style="color: #990000;">&quot;false&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>columns<span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Arquivo&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;150&quot;</span> dataField=<span style="color: #990000;">&quot;name&quot;</span> <span style="color: #004993;">wordWrap</span>=<span style="color: #990000;">&quot;true&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Tamanho&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;50&quot;</span> dataField=<span style="color: #990000;">&quot;size&quot;</span> textAlign=<span style="color: #990000;">&quot;right&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Status&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;50&quot;</span> dataField=<span style="color: #990000;">&quot;status&quot;</span> textAlign=<span style="color: #990000;">&quot;right&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>columns<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGrid<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Canvas<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>ControlBar horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span> verticalAlign=<span style="color: #990000;">&quot;middle&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Button
			id=<span style="color: #990000;">&quot;btnAdd&quot;</span>
			toolTip=<span style="color: #990000;">&quot;Adicionar arquivo(s)&quot;</span>
			<span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;addFiles()&quot;</span>
			label=<span style="color: #990000;">&quot;Upload : Arquivo(s)&quot;</span>
			<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;150&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Button
			label=<span style="color: #990000;">&quot;Limpar lista&quot;</span>
			<span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;{clearUploadList()}&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>ControlBar<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Panel<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p><strong>Download:</strong></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1941code21'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p194121"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
</pre></td><td class="code" id="p1941code21"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Panel
	xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
	layout=<span style="color: #990000;">&quot;vertical&quot;</span>
	<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span>
	title=<span style="color: #990000;">&quot;Download : Arquivos&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Alert<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>collections<span style="color: #000066; font-weight: bold;">.</span>ArrayCollection<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>FaultEvent<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ResultEvent<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>rpc<span style="color: #000066; font-weight: bold;">.</span>AsyncToken<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> downloadFiles<span style="color: #000066; font-weight: bold;">:</span>ArrayCollection = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> downloadFilesColl<span style="color: #000066; font-weight: bold;">:</span>ArrayCollection = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> fileData<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=bytearray%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bytearray.html"><span style="color: #004993;">ByteArray</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=bytearray%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bytearray.html"><span style="color: #004993;">ByteArray</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> fileName<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> downloadResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>token<span style="color: #000066; font-weight: bold;">.</span>kind == <span style="color: #990000;">&quot;remoteFileList&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					downloadFiles<span style="color: #000066; font-weight: bold;">.</span>removeAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					downloadFilesColl = event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> ArrayCollection<span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span>  downloadFilesColl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						downloadFiles<span style="color: #000066; font-weight: bold;">.</span>addItem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>
							<span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">:</span>downloadFilesColl<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">,</span>
							<span style="color: #004993;">size</span><span style="color: #000066; font-weight: bold;">:</span>downloadFilesColl<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">size</span><span style="color: #000066; font-weight: bold;">,</span>
							<span style="color: #004993;">status</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #990000;">&quot;Inicial&quot;</span>
						<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #000000;">&#125;</span>
					listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider = downloadFiles<span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>token<span style="color: #000066; font-weight: bold;">.</span>kind == <span style="color: #990000;">&quot;remoteDeleteFile&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					getRemoteFiles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span>  <span style="color: #000000;">&#123;</span>
					fileData = event<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=bytearray%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:bytearray.html"><span style="color: #004993;">ByteArray</span></a><span style="color: #000066; font-weight: bold;">;</span>
					fileName = event<span style="color: #000066; font-weight: bold;">.</span>token<span style="color: #000066; font-weight: bold;">.</span>kind<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
					Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span>fileName<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
					<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">b</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> <span style="color: #004993;">b</span> <span style="color: #000066; font-weight: bold;">&lt;</span>  downloadFiles<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">;</span> <span style="color: #004993;">b</span><span style="color: #000066; font-weight: bold;">++</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
						<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> downloadFiles<span style="color: #000000;">&#91;</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> == event<span style="color: #000066; font-weight: bold;">.</span>token<span style="color: #000066; font-weight: bold;">.</span>kind <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
							downloadFiles<span style="color: #000000;">&#91;</span><span style="color: #004993;">b</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">status</span> = <span style="color: #990000;">&quot;Pronto&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
							listFiles<span style="color: #000066; font-weight: bold;">.</span>dataProvider  = downloadFiles<span style="color: #000066; font-weight: bold;">;</span>
							<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
						<span style="color: #000000;">&#125;</span>
					<span style="color: #000000;">&#125;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> faultResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>FaultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> saveFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> fileReference<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=filereference%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:filereference.html"><span style="color: #004993;">FileReference</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=filereference%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:filereference.html"><span style="color: #004993;">FileReference</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				fileReference<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">save</span><span style="color: #000000;">&#40;</span>fileData<span style="color: #000066; font-weight: bold;">,</span>fileName<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> getRemoteFiles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> token<span style="color: #000066; font-weight: bold;">:</span>AsyncToken = AsyncToken<span style="color: #000000;">&#40;</span>remoteDownload<span style="color: #000066; font-weight: bold;">.</span>getDownloadList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				token<span style="color: #000066; font-weight: bold;">.</span>kind = <span style="color: #990000;">&quot;remoteFileList&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> getDownload<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> token<span style="color: #000066; font-weight: bold;">:</span>AsyncToken = AsyncToken<span style="color: #000000;">&#40;</span>remoteDownload<span style="color: #000066; font-weight: bold;">.</span>doDownload<span style="color: #000000;">&#40;</span>listFiles<span style="color: #000066; font-weight: bold;">.</span>selectedItem<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				token<span style="color: #000066; font-weight: bold;">.</span>kind = listFiles<span style="color: #000066; font-weight: bold;">.</span>selectedItem<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> doDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> token<span style="color: #000066; font-weight: bold;">:</span>AsyncToken = AsyncToken<span style="color: #000000;">&#40;</span>remoteDownload<span style="color: #000066; font-weight: bold;">.</span>doDelete<span style="color: #000000;">&#40;</span>listFiles<span style="color: #000066; font-weight: bold;">.</span>selectedItem<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				token<span style="color: #000066; font-weight: bold;">.</span>kind = <span style="color: #990000;">&quot;remoteDeleteFile&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>RemoteObject
		id=<span style="color: #990000;">&quot;remoteDownload&quot;</span>
		destination=<span style="color: #990000;">&quot;fileUtilService&quot;</span>
		result=<span style="color: #990000;">&quot;downloadResultHandler(event)&quot;</span>
		fault=<span style="color: #990000;">&quot;faultResultHandler(event)&quot;</span>
		showBusyCursor=<span style="color: #990000;">&quot;true&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Canvas <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGrid id=<span style="color: #990000;">&quot;listFiles&quot;</span> <span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">bottom</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;0&quot;</span>
			verticalScrollPolicy=<span style="color: #990000;">&quot;on&quot;</span>
			draggableColumns=<span style="color: #990000;">&quot;false&quot;</span> resizableColumns=<span style="color: #990000;">&quot;false&quot;</span> sortableColumns=<span style="color: #990000;">&quot;false&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>columns<span style="color: #000066; font-weight: bold;">&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Arquivo&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;150&quot;</span> dataField=<span style="color: #990000;">&quot;name&quot;</span> <span style="color: #004993;">wordWrap</span>=<span style="color: #990000;">&quot;true&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Tamanho&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;50&quot;</span> dataField=<span style="color: #990000;">&quot;size&quot;</span> textAlign=<span style="color: #990000;">&quot;right&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
				<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Status&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;50&quot;</span> dataField=<span style="color: #990000;">&quot;status&quot;</span> textAlign=<span style="color: #990000;">&quot;right&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
			<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>columns<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGrid<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Canvas<span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>ControlBar horizontalAlign=<span style="color: #990000;">&quot;center&quot;</span> verticalAlign=<span style="color: #990000;">&quot;middle&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Button id=<span style="color: #990000;">&quot;btnList&quot;</span> toolTip=<span style="color: #990000;">&quot;Listar arquivos remotos&quot;</span>
			label=<span style="color: #990000;">&quot;Listar arquivos&quot;</span>
			<span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;getRemoteFiles()&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Button id=<span style="color: #990000;">&quot;btnRetrieve&quot;</span> toolTip=<span style="color: #990000;">&quot;Pegar arquivo&quot;</span>
			 <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;getDownload()&quot;</span> label=<span style="color: #990000;">&quot;Pegar arquivo&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Button id=<span style="color: #990000;">&quot;btnSave&quot;</span> toolTip=<span style="color: #990000;">&quot;Salvar arquivo&quot;</span>
			 <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;saveFile()&quot;</span> label=<span style="color: #990000;">&quot;Salvar arquivo&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;Apagar arquivo&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;doDelete()&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>ControlBar<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Panel<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p><strong>Considerações:</strong></p>
<p>Esta forma de transferir arquivos&#160; pode-lhe ser útil, assim como para mim o foi, onde em um caso eu precisava enviar uma coleção de objetos para o Java, sendo dessa coleção de dados gerados um relatório através do Jasperreports, onde o PDF me retorna via a funcionalidade de download apresentada nesse exemplo.</p>
<p>&#160;</p>
<p><strong>Download projeto:</strong> [<a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/UploadDownloadBlazeDS.zip">UploadDownloadBlazeDS</a>]</p>
<p><strong>obs.:</strong><br />
  &#8211; em Adobe Flex Builder 3<br />
  &#8211; sem as libs do BlazeDS [efetuar o <a href="http://opensource.adobe.com/wiki/display/blazeds/download+blazeds+3">download</a> e acrescentar no projeto para executar]</p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1941&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/05/12/adobe-flex-blazeds-e-um-problema-de-conexao-no-servidor/" title="Adobe Flex + BlazeDS e um problema de conexão no servidor">Adobe Flex + BlazeDS e um problema de conexão no servidor</a></li><li><a href="http://blog.erkobridee.com/2008/06/14/construindo-aplicacoes-web-e-desktop-com-blazeds-e-amf/" title="Construindo aplicações Web e Desktop com BlazeDS e AMF">Construindo aplicações Web e Desktop com BlazeDS e AMF</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/" title="Adobe Flash Builder + Flex 4 + BlazeDS 4">Adobe Flash Builder + Flex 4 + BlazeDS 4</a></li><li><a href="http://blog.erkobridee.com/2010/03/27/actionscript-3-flash-player-10-localfilehelper/" title="ActionScript 3 + Flash Player 10+ : LocalFileHelper">ActionScript 3 + Flash Player 10+ : LocalFileHelper</a></li><li><a href="http://blog.erkobridee.com/2009/11/28/api-xuggler-edicao-de-video-em-tempo-real/" title="API &#8211; Xuggler : edição de vídeo em tempo real">API &#8211; Xuggler : edição de vídeo em tempo real</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flex 4 SDK e Flash Builder 4 liberados oficialmente</title>
		<link>http://blog.erkobridee.com/2010/03/22/flex-4-sdk-e-flash-builder-4-liberados-oficialmente/</link>
		<comments>http://blog.erkobridee.com/2010/03/22/flex-4-sdk-e-flash-builder-4-liberados-oficialmente/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 04:56:54 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Final Release]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[SDK]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=1838</guid>
		<description><![CDATA[E estamos começando bem, com uma excelente notícia para a comunidade Flex, que assim como eu estavam esperando a versão oficial para usar em algum projeto para valer, então é chegada a hora...]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F22%2Fflex-4-sdk-e-flash-builder-4-liberados-oficialmente%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F22%2Fflex-4-sdk-e-flash-builder-4-liberados-oficialmente%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>E estamos começando bem, com uma excelente notícia para a comunidade Flex, que assim como eu estavam esperando a versão oficial para usar em algum projeto para valer, então é chegada a hora&#8230;</p>
<p>Agora de madrugada (22/03/2010) vendo as últimas novidades no Google Reader [tá não sou normal, madrugada de domingo para segunda lendo notícias...] eis que vejo um post no blog oficial do time de desenvolvimento do Flex a notícia que eu tanto aguardava&#8230; estão liberados oficialmente o <strong>Flex 4 SDK e o Flash Builder 4</strong> veja o post oficial <strong><a href="http://blogs.adobe.com/flex/archives/2010/03/flex_4_sdk_and_flash_builder_4.html">[link]</a></strong></p>
<p>E junto a essa tão aguardada novidade observei +2 novidades, o site do <a href="http://www.adobe.com/products/flex/">Flex/Flash Builder</a> e o site do <a href="http://flex.org/">Flex.org</a> foram remodelados.</p>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/flex-product.png"><img class="aligncenter size-medium wp-image-1839" title="flex-product" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/flex-product-300x165.png" alt="" width="300" height="165" /></a></p>
<p style="text-align: center;"><strong><a href="http://www.adobe.com/products/flex/">Flex Product</a></strong></p>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/flexorg.png"><img class="aligncenter size-medium wp-image-1840" title="flexorg" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/flexorg-300x165.png" alt="" width="300" height="165" /></a></p>
<p style="text-align: center;"><strong><a href="http://flex.org/">Flex.org</a></strong></p>
<blockquote><p>A página de exibição de implementações (showcase) está de volta nesse novo site.</p>
</blockquote>
<p><br class="spacer_" /></p>
<p>Além disso temos algumas publicações associadas a essas novidades, segue:</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_whatsnew.html">O que há de novo no Flash Builder 4</a></strong> (inglês)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/articles/flex4sdk_whatsnew.html">O que há de novo no Flex 4 SDK</a></strong> (inglês)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html">Diferenças entre Flex 3 e o Flex 4</a></strong> (inglês)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/">Flex Developer Center</a></strong> (foi atualizado para assuntos relacionados ao Flex 4)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://tv.adobe.com/watch/flash-platform-in-action/introducing-new-flash-platform-tools/">Apresentando as novas ferramentas da plataforma Flash</a></strong> (vídeo em inglês)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/testdrive/">Flex Test Drive</a></strong> (inglês)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/videotraining/">Flex em uma semana</a></strong> (inglês &#8211; vídeo treinamento atualizado para o Flex 4)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://cookbooks.adobe.com/flex">Adobe Flex Cookbook</a></strong> (inglês)</p>
<p style="padding-left: 30px;"><strong>- <a href="http://www.adobe.com/devnet/flex/tourdeflex/">Tour de Flex</a></strong> &#8211; também atualizado (inglês)</p>
<p style="padding-left: 30px;">- Começando a utilizar o Flash Builder : <strong><a href="http://www.adobe.com/devnet/flex/testdrive/">Flex Test Drive</a></strong> (inglês)</p>
<p style="padding-left: 30px;">- <strong><a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins">Extensões para desenvolver Skins</a></strong></p>
<p><br class="spacer_" /></p>
<p>Só lembrando uma recomendação oficial, caso você tenha instalado a versão beta do Flex 4 e do Flash Builder 4, desinstalar primeiro a versão beta, para depois instalar essa versão oficial liberada.</p>
<p><br class="spacer_" /></p>
<p>Caso você seja um desenvolvedor <em><strong>Java </strong></em>+ <em><strong>Flex</strong></em> como eu, segue alguns links úteis:</p>
<p style="padding-left: 30px;">- <a href="http://imasters.uol.com.br/artigo/16314/flex/adobe_flex_4_duvidas_que_voce_tem_mas_nao_teve_coragem_de_perguntar/">Adobe Flex 4: dúvidas que você tem mas não teve coragem de perguntar!</a></p>
<p style="padding-left: 30px;">- Stefan Horochovec :</p>
<p style="padding-left: 60px;">- <a href="http://www.horochovec.com.br/blog/2010/03/23/flash-builder-flex-sdk-4-java-blazeds-tutorial/">Flash Builder + Flex SDK 4 + Java + BlazeDS – Tutorial</a></p>
<p style="padding-left: 60px;">- <a href="http://www.horochovec.com.br/blog/2010/03/24/flex-4-blazeds-4-java-datawizards/">Flex 4 + BlazeDS 4 + Java + DataWizards</a></p>
<p style="padding-left: 30px;">- <a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_datawizards_spring.html">Flash Builder 4 Data Wizards with Java and Spring</a></p>
<p style="padding-left: 30px;">- <a href="http://www.adobe.com/devnet/flex/articles/flex4_hibernate.html">Flex 4, Java, Spring, and Hibernate in Flash Builder 4</a></p>
<p style="padding-left: 30px;">- <a href="http://coenraets.org/blog/2010/03/flex-4-sample-application-using-a-java-back-end-blazeds-4-and-flash-builder-4-data-wizards/">Flex 4 Sample Application using a Java Back-End, BlazeDS 4 and Flash Builder 4 Data Wizards</a></p>
<p style="padding-left: 30px;">- <a href="http://blog.lyraspace.com/2009/07/28/mate-framework-and-flex-4-sdk/">Mate Framework + Flex 4 SDK</a></p>
<p style="padding-left: 30px;">- Debugging Flex 4 applications</p>
<p style="padding-left: 60px;">1 &#8211; <a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_debugging_part1.html">Part 1: Debugging basics</a></p>
<p style="padding-left: 60px;">2 &#8211; <a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_debugging_part2.html">Part 2: Breakpoints</a></p>
<p style="padding-left: 60px;">3 &#8211; <a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_debugging_part3.html">Part 3: Variables view, watchpoints, and Run to Line</a></p>
<p><br class="spacer_" /></p>
<p>Outros posts sobre o assunto que recomendo a leitura:</p>
<p style="padding-left: 30px;">- <a href="http://msdevstudio.com/blog/2010/03/22/developers-flex-oficialmente-desactualizados-fb4/">Mário Santos : Developers Flex, Oficialmente Desactualizados! FB4!</a></p>
<p style="padding-left: 30px;">- <a href="http://www.igorcosta.com/blog/?p=1010">Igor Costa : Flex 4 oficialmente lançado</a></p>
<p style="padding-left: 30px;">- <a href="http://blog.mxml.com.br/flash-builder-4-disponivel-hoje">Eduardo Kraus : Flash Builder 4 disponível hoje</a></p>
<p><br class="spacer_" /></p>
<p>E para você que quer estudar e não tem dinheiro para comprar o Flash Builder, tenho uma excelente notícia para você:</p>
<p style="text-align: center;"><a href="https://freeriatools.adobe.com/"><img class="aligncenter size-full wp-image-1846" title="fb41" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/fb41.gif" alt="" width="490" height="452" /></a><a href="https://freeriatools.adobe.com/">https://freeriatools.adobe.com/</a></p>
<blockquote><p>Conforme notificado no blog: <strong><a href="http://theflashblog.com/?p=1868">TheFlashBlog</a></strong></p>
</blockquote>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1838&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/18/flex-air-swiz-framework-presentation-model-exemplo-de-projeto/" title="[Flex &#038; AIR] Swiz Framework + Presentation Model : Exemplo de Projeto">[Flex &#038; AIR] Swiz Framework + Presentation Model : Exemplo de Projeto</a></li><li><a href="http://blog.erkobridee.com/2010/05/12/adobe-flex-blazeds-e-um-problema-de-conexao-no-servidor/" title="Adobe Flex + BlazeDS e um problema de conexão no servidor">Adobe Flex + BlazeDS e um problema de conexão no servidor</a></li><li><a href="http://blog.erkobridee.com/2010/03/29/adobe-flex-links-preloader-style-layout-e-skin/" title="Adobe Flex links: Preloader, Style, Layout e Skin">Adobe Flex links: Preloader, Style, Layout e Skin</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flash-builder-flex-4-blazeds-4/" title="Adobe Flash Builder + Flex 4 + BlazeDS 4">Adobe Flash Builder + Flex 4 + BlazeDS 4</a></li><li><a href="http://blog.erkobridee.com/2010/03/28/adobe-flex-3-5-uploaddownloadblazeds/" title="Adobe Flex 3.5 : UploadDownloadBlazeDS">Adobe Flex 3.5 : UploadDownloadBlazeDS</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/22/flex-4-sdk-e-flash-builder-4-liberados-oficialmente/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adobe AIR e SQLite</title>
		<link>http://blog.erkobridee.com/2010/03/12/adobe-air-e-sqlite/</link>
		<comments>http://blog.erkobridee.com/2010/03/12/adobe-air-e-sqlite/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 17:07:20 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Banco de Dados]]></category>
		<category><![CDATA[Administração]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Ferramenta]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=1789</guid>
		<description><![CDATA[Post sobre o Adobe AIR e base de dados local utilizando o SQLite]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F12%2Fadobe-air-e-sqlite%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F12%2Fadobe-air-e-sqlite%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/adobe_air_log.jpg"><img class="aligncenter size-full wp-image-1790" title="adobe_air_log" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/adobe_air_log.jpg" alt="" width="370" height="200" /></a><a href="http://www.adobe.com/products/air/"> Adobe AIR [Site]</a></p>
<p><br class="spacer_" /></p>
<p>Adobe AIR destina-se a ser um ambiente versátio que possibilita utilizar as tecnologias existentes, Flash, Actionscript ou HTML + JavaScript, para construir os mais tradicionais programas ao estilo desktop. Segundo a Adobe seria um ambiente para aplicações RIA (<em>Rich Internet Application</em> | Aplicação de internet rica) com uma cara menos <em>WebBrowser</em>, sendo estas acessadas diretamente do desktop. A diferença de publicação na web ou desktop depara-se com vantagens e desvantagens, por exemplo, uma RIA publicada na web, não precisa de instalação, enquanto uma aplicação em Adobe AIR necessita ser instalada, com isso terá acesso aos recursos locais da máquina.</p>
<p><br class="spacer_" /></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/SQLite.gif"><img class="aligncenter size-full wp-image-1791" title="SQLite" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/SQLite.gif" alt="" width="327" height="97" /></a></p>
<p style="text-align: center;"><a href="http://www.sqlite.org/">SQLite [Site]</a></p>
<p style="text-align: center;"> </p>
<p>SQLite é uma biblioteca de software que implementa um &#8220;auto-contido&#8221; (<em>em arquivo</em>), servidor de base de dados transacional de SQL sem necessidade de configuração. O código fonte do SQLite é de domínio público.</p>
<blockquote><p>O Adobe AIR utiliza o SQLite versão 3, como base de dados para as aplicações, onde é gerado um arquivo .db da base de dados. O Adobe AIR dispõem de um suporte nativo para utilizar esta base de dados.</p>
</blockquote>
<p><br class="spacer_" /></p>
<p><strong>1.</strong> Aplicações em Adobe AIR para gerenciamento de base de dados SQLite</p>
<p style="padding-left: 30px;"><strong>1.1</strong> <a href="/?p=1789&amp;page=2">Lita &#8211; Ferramenta de administração de base SQLite</a></p>
<p style="padding-left: 30px;"><strong>1.2</strong> <a href="/?p=1789&amp;page=3">The SQLite Sorcerer &#8211; Meu SQLite, ferramenta de administração</a></p>
<p style="padding-left: 30px;"><strong>1.3 </strong><a href="/?p=1789&amp;page=3">SQLite Admin for AIR</a></p>
<p><strong>2.</strong> <a href="/?p=1789&amp;page=4">Formar de trabalhar Adobe AIR + SQLite</a></p>
<p><br class="spacer_" /></p>
<p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1789&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/07/24/adobe-air-2-nativeprocess-java-simpleairjava/" title="[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava">[Adobe AIR 2 : NativeProcess + Java] SimpleAirJava</a></li><li><a href="http://blog.erkobridee.com/2009/11/17/adobe-air-2-0-beta-disponivel/" title="Adobe AIR 2.0 beta : disponível">Adobe AIR 2.0 beta : disponível</a></li><li><a href="http://blog.erkobridee.com/2009/11/03/tuberadio-fm-ferramenta-para-localizar-musica-no-youtube/" title="Tuberadio.fm : ferramenta para localizar música no Youtube">Tuberadio.fm : ferramenta para localizar música no Youtube</a></li><li><a href="http://blog.erkobridee.com/2009/06/22/colabo-ferramenta-colaborativa/" title="Colabo &#8211; Ferramenta colaborativa">Colabo &#8211; Ferramenta colaborativa</a></li><li><a href="http://blog.erkobridee.com/2009/06/02/adobe-air-levando-os-militares-de-amanha/" title="Adobe AIR levando os militares de amanhã">Adobe AIR levando os militares de amanhã</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/12/adobe-air-e-sqlite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
