<?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; Adobe Flex</title>
	<atom:link href="http://blog.erkobridee.com/t/adobe-flex/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 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>Adobe Flex links: Preloader, Style, Layout e Skin</title>
		<link>http://blog.erkobridee.com/2010/03/29/adobe-flex-links-preloader-style-layout-e-skin/</link>
		<comments>http://blog.erkobridee.com/2010/03/29/adobe-flex-links-preloader-style-layout-e-skin/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 20:54:10 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Catalyst]]></category>
		<category><![CDATA[Adobe Fireworks]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Adobe Photoshop]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[ScaleNine]]></category>
		<category><![CDATA[Skin]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=2026</guid>
		<description><![CDATA[Vamos a um post útil, uma coleção de links e materiais que irão lhe ajudar, quando precisar desenvolver/definir um layout customizado para sua aplicação Adobe Flex, segue...]]></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%2F29%2Fadobe-flex-links-preloader-style-layout-e-skin%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F29%2Fadobe-flex-links-preloader-style-layout-e-skin%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Vamos a um post útil, uma coleção de links e materiais que irão lhe ajudar, quando precisar desenvolver/definir um layout customizado para sua aplicação Adobe Flex, segue&#8230;</p>
<p><br class="spacer_" /></p>
<ul>
<li>Criando um preloader no Adobe Flash<strong> [<a href="http://www.gotoandlearn.com/play?id=85">link</a>]<br />
 </strong></li>
</ul>
<ul>
<li>Utilizando um preloader no Adobe Flex 3 (será usado na aplicação nesse formato)<strong> [<a href="http://www.flexer.info/2008/02/07/very-first-flex-preloader-customization/">link</a>]<br />
 </strong></li>
</ul>
<ul>
<li>+links sobre preloader<strong> [<a href="http://delicious.com/erko.bridee/preloader">link</a>]<br />
 </strong></li>
</ul>
<p><br class="spacer_" /></p>
<p>&#8212;-</p>
<ul>
<li>Flex 3 Style Explorer <strong>[<a href="http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html">link</a>]</strong><br class="spacer_" /></li>
</ul>
<ul>
<li>ScaleNine <strong>[<a href="http://www.scalenine.com/">link</a>]<br />
 </strong></li>
</ul>
<ul>
<li>Learn about UI design and explore RIA workflows <strong>[<a href="http://www.adobe.com/devnet/flex/design.html">link</a>]<br />
 </strong></li>
</ul>
<ul>
<li>Exemplos de definições skin/layout<strong> [<a href="http://www.scalenine.com/gallery/index.php">link</a>]<br />
 </strong></li>
</ul>
<blockquote>
<ul>
<li>Um exemplo que acho interessante: Undefined Skin One <strong>[<a href="http://www.scalenine.com/themes/undefined/Undefined.html">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<p><br class="spacer_" /></p>
<p>&#8212;-</p>
<ul>
<li>Adobe Flash Catalyst<strong> [<a href="http://labs.adobe.com/technologies/flashcatalyst/">link</a>]</strong></li>
</ul>
<blockquote>
<ul>
</ul>
<ul>
<li>Introducing Flash Catalyst <strong>[<a href="http://labs.adobe.com/technologies/flashcatalyst/tutorials/overview/">link</a>]</strong></li>
</ul>
<ul>
<li>Adobe Flash Catalyst: Crie interface interativas de arquivos PSD, AI e PNG<strong> [<a href="http://www.allanbrito.com/2009/06/02/adobe-flash-catalyst-crie-interface-interativas-de-arquivos-psd-ai-e-png/">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>[Vedovelli] Screencast: Adobe Catalyst e Flex 4 (Gumbo) <strong>[<a href="http://www.vedovelli.com.br/?p=623">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>[Curso online] Flash Catalyst Beta Preview<strong> [<a href="http://www.lynda.com/home/DisplayCourse.aspx?lpk2=778&amp;utm_source=LDC&amp;utm_medium=viral&amp;utm_content=flash_catalyst&amp;utm_campaign=flash_catalyst">link</a>]</strong></li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>Screencast: Intro to Adobe Flash Catalyst<strong> [<a href="http://scalenine.com/blog/2008/11/26/screencast-intro-to-adobe-flash-catalyst/">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>Round Trip in Adobe Flash Catalyst and Adobe Illustrator <strong>[<a href="http://www.insideria.com/2009/03/round-trip-in-adobe-flash-cata.html">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<p><br class="spacer_" /></p>
<p>&#8212;-</p>
<ul>
<li>Definindo layout no Fireworks (links)<strong> [<a href="http://delicious.com/erko.bridee/fireworks">link</a>]<br />
 </strong></li>
</ul>
<blockquote>
<ul>
<li>Foundation Flex for Designers excerpt: Flex and Fireworks<strong> [<a href="http://www.adobe.ca/devnet/flex/articles/flex_fireworks.html">link</a>]</strong></li>
</ul>
</blockquote>
<p><br class="spacer_" /></p>
<p>&#8212;-</p>
<ul>
<li>Definindo layout no Photoshop (links)<strong> [<a href="http://delicious.com/erko.bridee/photoshop">link</a>]<br />
 </strong></li>
</ul>
<blockquote>
<ul>
<li>Foundation Flex for Designers excerpt: Flex with Photoshop and Illustrator<strong> [<a href="http://www.adobe.com/devnet/flex/articles/flex_photoshop_illustrator.html">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<p><br class="spacer_" /></p>
<p>&#8212;-</p>
<ul>
<li>Guia de desenvolvimento de layout/skin para Adobe Flex 3<strong> [<a href="http://www.scalenine.com/contest/getting-started.php">link</a>]<br />
 </strong></li>
</ul>
<ul>
<li>Designing Flex 3 skins and styles using Creative Suite 3 and Flex Builder 3<strong> [<a href="http://www.adobe.com/devnet/flex/articles/skins_styles.html">link</a>]<br />
 </strong></li>
</ul>
<ul>
<li>Designing Flex 2 skins with Flash, Photoshop, Fireworks, or Illustrator<strong> [<a href="http://www.adobe.com/devnet/flex/articles/flex_skins.html">link</a>]<br />
 </strong></li>
</ul>
<blockquote>
<ul>
<li>Necessário: Flex Skin Extensions (extensões para Fireworks e Photoshop) [necessário login na Adobe (o cadastro é gratuito)]<strong> [<a href="https://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins">link</a>]<br />
 </strong></li>
</ul>
</blockquote>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=2026&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/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/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/2010/03/27/actionscript3-querystring/" title="ActionScript3 : QueryString">ActionScript3 : QueryString</a></li><li><a href="http://blog.erkobridee.com/2010/03/22/flex-4-sdk-e-flash-builder-4-liberados-oficialmente/" title="Flex 4 SDK e Flash Builder 4 liberados oficialmente">Flex 4 SDK e Flash Builder 4 liberados oficialmente</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/29/adobe-flex-links-preloader-style-layout-e-skin/feed/</wfw:commentRss>
		<slash:comments>1</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('p1941code5'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p19415"><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="p1941code5"><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('p1941code6'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p19416"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1941code6"><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('p1941code7'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p19417"><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="p1941code7"><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('p1941code8'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p19418"><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="p1941code8"><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>ActionScript 3 + Flash Player 10+ : LocalFileHelper</title>
		<link>http://blog.erkobridee.com/2010/03/27/actionscript-3-flash-player-10-localfilehelper/</link>
		<comments>http://blog.erkobridee.com/2010/03/27/actionscript-3-flash-player-10-localfilehelper/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 01:03:58 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Portifólio]]></category>
		<category><![CDATA[Adobe Flash Player 10]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Arquivo]]></category>
		<category><![CDATA[Código]]></category>
		<category><![CDATA[Exemplo]]></category>
		<category><![CDATA[Local]]></category>
		<category><![CDATA[Projeto]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/2010/03/27/actionscript-3-flash-player-10-localfilehelper/</guid>
		<description><![CDATA[Neste post vou compartilhar com vocês um suporte que me é muito útil nos projetos que ando desenvolvendo, onde necessito abrir algum arquivo local da máquina do usuário da aplicação e posteriormente caso necessário salvar um arquivo… Como comentado, em um projeto tive a necessidade de trabalhar com arquivos locais do usuário em uma aplicaçã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%2F27%2Factionscript-3-flash-player-10-localfilehelper%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F27%2Factionscript-3-flash-player-10-localfilehelper%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Neste post vou compartilhar com vocês um suporte que me é muito útil nos projetos que ando desenvolvendo, onde necessito abrir algum arquivo local da máquina do usuário da aplicação e posteriormente caso necessário salvar um arquivo…</p>
<p> <span id="more-1935"></span></p>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/LocalFileHelper.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="LocalFileHelper" border="0" alt="LocalFileHelper" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/LocalFileHelper_thumb.png" width="416" height="303" /></a>Como comentado, em um projeto tive a necessidade de trabalhar com arquivos locais do usuário em uma aplicação <strong><em>Adobe Flex 3.5</em></strong>, para isto fiz uso da classe <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html">FileReference</a> [métodos <em><strong>load</strong></em> e <strong><em>save</em></strong>] com a versão do <strong><em>Adobe Flash Player 10+</em></strong>, onde também foi incluso o suporte para exibir o progresso da leitura e escrita dos arquivos no computador local, conforme a imagem acima. </p>
<p>&#160;</p>
<p>Segue o código da aplicação de teste vista na imagem:</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('p1935code10'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p193510"><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
</pre></td><td class="code" id="p1935code10"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&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>VBox
	xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
	<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;400&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;300&quot;</span>
	creationComplete=<span style="color: #990000;">&quot;init()&quot;</span> horizontalAlign=<span style="color: #990000;">&quot;center&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> com<span style="color: #000066; font-weight: bold;">.</span>erkobridee<span style="color: #000066; font-weight: bold;">.</span>flex<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>file<span style="color: #000066; font-weight: bold;">.</span>LocalFileHelper<span style="color: #000066; font-weight: bold;">;</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>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>erkobridee<span style="color: #000066; font-weight: bold;">.</span>flex<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>file<span style="color: #000066; font-weight: bold;">.</span>enum<span style="color: #000066; font-weight: bold;">.*;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>erkobridee<span style="color: #000066; font-weight: bold;">.</span>flex<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>file<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> localFileHelper<span style="color: #000066; font-weight: bold;">:</span>LocalFileHelper<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><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>
				localFileHelper = <span style="color: #0033ff; font-weight: bold;">new</span> LocalFileHelper<span style="color: #000000;">&#40;</span> FileTypeFormat<span style="color: #000066; font-weight: bold;">.</span>FILE_FILTER_TEXT_TYPE <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_LOAD_BROWSE<span style="color: #000066; font-weight: bold;">,</span> onFileSelect<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_SAVE_BROWSE<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #339966; font-weight: bold;">function</span><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: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Save browse complete&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;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_SAVE_SUCCESSFULLY<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #339966; font-weight: bold;">function</span><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: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Save complete!&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;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_CANCEL<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #339966; font-weight: bold;">function</span><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> 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;Cancel&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;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileErrorEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_ERROR<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #339966; font-weight: bold;">function</span><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: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;file error&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileLoadProgressEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_LOAD_PROGRESS<span style="color: #000066; font-weight: bold;">,</span> onLoadProgress<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileSaveProgressEvent<span style="color: #000066; font-weight: bold;">.</span>FILE_SAVE_PROGRESS<span style="color: #000066; font-weight: bold;">,</span> onSaveProgress<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> loadFile<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: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">browse</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>
&nbsp;
			<span style="color: #009900; font-style: italic;">//------- SAVE</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>
&nbsp;
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">save</span><span style="color: #000000;">&#40;</span> output<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;output.txt&quot;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">reset</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>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">reset</span><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>
				loadProgressBar<span style="color: #000066; font-weight: bold;">.</span>setProgress<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				saveProgressBar<span style="color: #000066; font-weight: bold;">.</span>setProgress<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				output<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
				<a href="http://www.google.com/search?q=system%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:system.html"><span style="color: #004993;">System</span></a><span style="color: #000066; font-weight: bold;">.</span>gc<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: #009900; font-style: italic;">//------------------------------------------------------------------</span>
			<span style="color: #009900; font-style: italic;">// event handlers</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>LocalFileEvent<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>
				localFileHelper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>LocalFileLoadedEvent<span style="color: #000066; font-weight: bold;">.</span>DATA_LOADED<span style="color: #000066; font-weight: bold;">,</span> onDataLoaded <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				localFileHelper<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>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onDataLoaded<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>LocalFileLoadedEvent<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>
				output<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = LocalFileHelper<span style="color: #000066; font-weight: bold;">.</span>convertByteArrayToText<span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>byteLoaded <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> onLoadProgress<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>LocalFileLoadProgressEvent<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>
				loadProgressBar<span style="color: #000066; font-weight: bold;">.</span>setProgress<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>done<span style="color: #000066; font-weight: bold;">,</span> event<span style="color: #000066; font-weight: bold;">.</span>total<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> onSaveProgress<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>LocalFileSaveProgressEvent<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>
				saveProgressBar<span style="color: #000066; font-weight: bold;">.</span>setProgress<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>done<span style="color: #000066; font-weight: bold;">,</span> event<span style="color: #000066; font-weight: bold;">.</span>total<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>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>TextArea
		id=<span style="color: #990000;">&quot;output&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>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>HBox <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>mx<span style="color: #000066; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;Load&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;loadFile()&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;Save&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;saveFile()&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;Reset&quot;</span> <span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;reset()&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>HBox<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>Form<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;File load&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>ProgressBar id=<span style="color: #990000;">&quot;loadProgressBar&quot;</span> <span style="color: #004993;">mode</span>=<span style="color: #990000;">&quot;manual&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>
&nbsp;
		<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;File save&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>ProgressBar id=<span style="color: #990000;">&quot;saveProgressBar&quot;</span> <span style="color: #004993;">mode</span>=<span style="color: #990000;">&quot;manual&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>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>VBox<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Caso queria o projeto [<a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/LocalFileHelper.zip">LocalFileHelper</a>] <strong>obs.:</strong> em Adobe Flex Builder 3</p>
<p>&#160;</p>
<p>Essa funcionalidade foi uma adaptação do código pacialmente disponível no post: <a href="http://elromdesign.com/blog/2009/05/14/flash-10-%e2%80%93-utility-class-to-read-and-write-local-files/">utility class to help reading/writing files in flash 10</a> devido a não encontrar o código disponível para o download, tive a necessidade de vasculhar e remontar o projeto.</p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1935&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/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/actionscript3-querystring/" title="ActionScript3 : QueryString">ActionScript3 : QueryString</a></li><li><a href="http://blog.erkobridee.com/2010/01/20/adobe-flex-filtrando-um-arraycollection-distinct/" title="[Adobe Flex] filtrando um ArrayCollection : Distinct">[Adobe Flex] filtrando um ArrayCollection : Distinct</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/03/27/actionscript-3-flash-player-10-localfilehelper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript3 : QueryString</title>
		<link>http://blog.erkobridee.com/2010/03/27/actionscript3-querystring/</link>
		<comments>http://blog.erkobridee.com/2010/03/27/actionscript3-querystring/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 03:57:27 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Código]]></category>
		<category><![CDATA[Exemplo]]></category>
		<category><![CDATA[Útil]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/2010/03/27/actionscript3-querystring/</guid>
		<description><![CDATA[Um tempo atrás conversando com o @jandersonfc [site], comentei sobre uma funcionalidade que estava utilizando nas minhas aplicações em Adobe Flex para ler parâmtros da URL e havia comentado que iria publicar, bom finalmente estou publicando, segue… Então aqui temos a nossa aplicação em Adobe Flex lendo os parâmetros da URL, para isto utilizaremos uma [...]]]></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%2F27%2Factionscript3-querystring%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F27%2Factionscript3-querystring%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Um tempo atrás conversando com o <a href="http://twitter.com/jandersonfc">@jandersonfc</a> [<a href="http://www.jandersonfc.com/">site</a>], comentei sobre uma funcionalidade que estava utilizando nas minhas aplicações em Adobe Flex para ler parâmtros da URL e havia comentado que iria publicar, bom finalmente estou publicando, segue…</p>
<p> <span id="more-1929"></span>
<p><a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/querystring.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="querystring" border="0" alt="querystring" src="http://blog.erkobridee.com/wp-content/uploads/2010/03/querystring_thumb.png" width="488" height="138" /></a></p>
<p>Então aqui temos a nossa aplicação em Adobe Flex lendo os parâmetros da URL, para isto utilizaremos uma classe de apoio que irá acessar via <a href="http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html">ExternalInterface</a> o HTML/Javascript da página para ler os parâmetros.</p>
<p>&#160;</p>
<p><strong>Aplicação Adobe Flex de teste:</strong>&#160;</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('p1929code13'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p192913"><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
</pre></td><td class="code" id="p1929code13"><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>Application 
	xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> 
	pageTitle=<span style="color: #990000;">&quot;Exemplo de uso QueryString&quot;</span>
	layout=<span style="color: #990000;">&quot;vertical&quot;</span> 
	creationComplete=<span style="color: #990000;">&quot;init()&quot;</span> horizontalAlign=<span style="color: #990000;">&quot;center&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> com<span style="color: #000066; font-weight: bold;">.</span>erkobridee<span style="color: #000066; font-weight: bold;">.</span>flex<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>html<span style="color: #000066; font-weight: bold;">.</span>QueryString<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> <span style="color: #004993;">init</span><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> query<span style="color: #000066; font-weight: bold;">:</span>QueryString = <span style="color: #0033ff; font-weight: bold;">new</span> QueryString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				param1Field<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = query<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">parameters</span><span style="color: #000066; font-weight: bold;">.</span>param1<span style="color: #000066; font-weight: bold;">;</span> 
				<span style="color: #009900; font-style: italic;">// ou &gt; query.parameters[&quot;param1&quot;];</span>
&nbsp;
				param2Field<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = query<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">parameters</span><span style="color: #000066; font-weight: bold;">.</span>param2<span style="color: #000066; font-weight: bold;">;</span> 
				<span style="color: #009900; font-style: italic;">// ou &gt; query.parameters[&quot;param2&quot;]; </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>
	<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>mx<span style="color: #000066; font-weight: bold;">:</span>FormItem label=<span style="color: #990000;">&quot;param1&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>TextInput id=<span style="color: #990000;">&quot;param1Field&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>FormItem label=<span style="color: #990000;">&quot;param2&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>TextInput id=<span style="color: #990000;">&quot;param2Field&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>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Application<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<blockquote>
<p><strong>Obs.:</strong> para executar o teste é necessário que a aplicação esteja em um servidor Web, para isto no Adobe Flex Builder, gerei o <em>Export bin-release</em> e o conteúdo dessa pasta criei uma pasta [ querystring ] no meu servidor Apache PHP [no Windows você pode usar o <a href="http://www.apachefriends.org/pt_br/xampp.html">XAMPP</a>] local </p>
</blockquote>
<p>&#160;</p>
<p><strong>Classe de auxílio para a leitura dos parâmetros da URL:</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('p1929code14'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p192914"><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
</pre></td><td class="code" id="p1929code14"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * Classe para auxiliar a leitura dos parâmetros presentes na URL
 * em uma aplicação Adobe Flex
 * 
 * Obs.: em todos os testes e uso até o presente momento, 
 * verifiquei a compatibilidade com os Web Browsers:
 * - Firefox
 * - Internet Explorer 8
 * - Google Chrome
 */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>erkobridee<span style="color: #000066; font-weight: bold;">.</span>flex<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>html <span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.external</span><span style="color: #000066; font-weight: bold;">.*;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> QueryString <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _queryString<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>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _all<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>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _params<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html"><span style="color: #004993;">Object</span></a><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> queryString<span style="color: #000000;">&#40;</span><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: #0033ff; font-weight: bold;">return</span> _queryString<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">url</span><span style="color: #000000;">&#40;</span><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: #0033ff; font-weight: bold;">return</span> _all<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">parameters</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html"><span style="color: #004993;">Object</span></a> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _params<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> QueryString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			readQueryString<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;">private</span> <span style="color: #339966; font-weight: bold;">function</span> readQueryString<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>
			_params = <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</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>
&nbsp;
				<span style="color: #009900; font-style: italic;">// acessa as informações da página HTML</span>
				_all =  <a href="http://www.google.com/search?q=externalinterface%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:externalinterface.html"><span style="color: #004993;">ExternalInterface</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">call</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;window.location.href.toString&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				_queryString = <a href="http://www.google.com/search?q=externalinterface%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:externalinterface.html"><span style="color: #004993;">ExternalInterface</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">call</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;window.location.search.substring&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_queryString<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
					<span style="color: #6699cc; font-weight: bold;">var</span> params<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> = _queryString<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'&amp;'</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = params<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</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=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">index</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: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">&lt;</span>length<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: #6699cc; font-weight: bold;">var</span> kvPair<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> = params<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
						<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">index</span> = kvPair<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;=&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
							<span style="color: #6699cc; font-weight: bold;">var</span> key<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> = kvPair<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">index</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
							<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">value</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> = kvPair<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">index</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
							_params<span style="color: #000000;">&#91;</span>key<span style="color: #000000;">&#93;</span> = <span style="color: #004993;">value</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> <span style="color: #0033ff; font-weight: bold;">catch</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html"><span style="color: #004993;">Error</span></a><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> 
				<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Some error occured. ExternalInterface doesn't work in Standalone player.&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>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>&#160;</p>
<p>Caso queria o projeto [<a href="http://blog.erkobridee.com/wp-content/uploads/2010/03/QueryString.zip">QueryString</a>] <strong>obs.:</strong> em <em>Adobe Flex Builder 3</em></p>
<p>&#160;</p>
<p>Essa solução foi publicada neste [<a href="http://www.abdulqabiz.com/blog/archives/2006/03/06/how-to-get-url-query-string-variables-within-flex-application/">post</a>] onde também foi disponibilizado uma versão web para testar essa solução [<a href="http://www.abdulqabiz.com/files/test/QueryStringSample.html?myName=Erko.Bridee&amp;myHomeTown=Curitiba.PR">aplicação de teste</a>]</p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1929&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/01/20/adobe-flex-comparando-datas-de-maneira-rapida-e-facil/" title="[Adobe Flex] comparando datas de maneira rápida e fácil">[Adobe Flex] comparando datas de maneira rápida e fácil</a></li><li><a href="http://blog.erkobridee.com/2010/01/20/adobe-flex-filtrando-um-arraycollection-distinct/" title="[Adobe Flex] filtrando um ArrayCollection : Distinct">[Adobe Flex] filtrando um ArrayCollection : Distinct</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/2009/02/28/adobe-flex-brigando-contra-o-crossdomain-resolvendo-com-um-xml-proxy/" title="Adobe Flex : brigando contra o crossdomain : resolvendo com um xml-proxy">Adobe Flex : brigando contra o crossdomain : resolvendo com um xml-proxy</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/27/actionscript3-querystring/feed/</wfw:commentRss>
		<slash:comments>1</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 Flex e os Shared Objects</title>
		<link>http://blog.erkobridee.com/2010/03/13/adobe-flex-e-os-shared-objects/</link>
		<comments>http://blog.erkobridee.com/2010/03/13/adobe-flex-e-os-shared-objects/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 04:11:46 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Shared Object]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=1813</guid>
		<description><![CDATA[Esta é uma funcionalidade existente para as aplicações Adobe Flex que pode lhe ser muito útil, para implementar funcionalidades como a de cookies, e/ou aliviar o uso de memória e coleção de objetos, 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%2F03%2F13%2Fadobe-flex-e-os-shared-objects%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F13%2Fadobe-flex-e-os-shared-objects%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Esta é uma funcionalidade existente para as aplicações Adobe Flex que pode lhe ser muito útil, para implementar funcionalidades como a de cookies, e/ou aliviar o uso de memória e coleção de objetos, confira&#8230;</p>
<p><br class="spacer_" /></p>
<p><strong>O que é?</strong></p>
<p>A função do Shared Objects (ShO) é armazenar um montante de dados no computador do cliente, funcionando como um cookies do browser. Assim, você pode armazenar dados e chamá-los durante a sessão atual ou em outra futura sessão. Contudo estes dados não podem ser acessados por outra aplicação Flex, mas sim apenas pela aplicação criadora.</p>
<p><br class="spacer_" /></p>
<p><strong>SharedObject.class</strong></p>
<p>Com esta classe você é capaz de realizar qualquer manipulação dos dados que ficarão armazenados no cliente. Esta possui os seguintes métodos:</p>
<ul>
<li><strong>clear()</strong> Limpa permanentemente todos os dados contidos no Shared Object.</li>
<li><strong>flush()</strong> Grava os dados do ShO no cliente.</li>
<li><strong>getLocal()</strong> Retorna uma instância do ShO no cliente, caso não exista o mesmo cria uma.</li>
<li><strong>getSize()</strong> Retorna o tamanho em Bytes do ShO no cliente. Uma observação o tamanho default é de <strong><em>100KB</em></strong>, contudo isto pode ser alterado para mais.</li>
</ul>
<blockquote><p>Apesar do tamanho inicial predefinido seja 100KB é possível expandir esse tamanho, acessando as <a href="http://www.macromedia.com/support/documentation/br/flashplayer/help/settings_manager03.html">configurações do Adobe Flash Player Runtime</a>, ou durante a execução da aplicação caso o tamanho do ShO exceda o tamanho pré definido o Adobe Flash Player Runtime irá lhe questionar se autoriza gravar mais dados além do valor inicial.</p>
</blockquote>
<p><br class="spacer_" /></p>
<p><strong>Links úteis do assunto:</strong></p>
<ul>
<li><a href="http://imasters.uol.com.br/artigo/13272/flex/usando_shared_objects/">Usando shared objects</a></li>
<li><a href="http://livedocs.adobe.com/flex/3/langref/flash/net/SharedObject.html">SharedObject &#8211; Adobe Flex 3.5 Referência da Linguagem</a></li>
<li><a href="http://livedocs.adobe.com/flex/3/html/help.html?content=lsos_3.html">SharedObject Criando Objeto &#8211; documentação oficial</a></li>
<li><a href="http://livedocs.adobe.com/flex/3/html/help.html?content=lsos_5.html">SharedObject exemplo da documentação oficial</a></li>
<li><a href="http://www.jandersonfc.com/sharedobjects-cookie-para-sua-app-flex/">SharedObjects – Cookie para sua app flex</a></li>
<li><a href="http://www.ronaldorigoni.com.br/controlando-login-em-flex-com-sharedobject/">Controlando Login em Flex com SharedObject</a></li>
<li><a href="http://learn.adobe.com/wiki/display/Flex/Shared+Objects">Shared Objects &#8211; Gettind Started</a></li>
<li><a href="http://www.codestore.net/store.nsf/unid/BLOG-20100310-0320">Flex: Using A SharedObject to Remember User Settings</a></li>
<li><a href="http://www.flexer.info/2008/05/09/using-shared-objects-login-process-with-remember-password/">Usando Shared Objects: Login process with remember password</a></li>
<li><a href="http://en.wikipedia.org/wiki/Local_Shared_Object">Local Shared Object &#8211; Wikipédia</a></li>
</ul>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1813&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2009/10/19/eduardo-kraus-adobe-flex-rtmp-red5-fms-pagseguro/" title="Eduardo Kraus : Adobe Flex : RTMP : Red5 &#038; FMS : PagSeguro">Eduardo Kraus : Adobe Flex : RTMP : Red5 &#038; FMS : PagSeguro</a></li><li><a href="http://blog.erkobridee.com/2009/03/06/adobe-flex-o-caminho-das-pedras/" title="Adobe Flex : o caminho das pedras">Adobe Flex : o caminho das pedras</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-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/13/adobe-flex-e-os-shared-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Vedovelli] Iniciando com o Mate Framework</title>
		<link>http://blog.erkobridee.com/2010/03/10/vedovelli-iniciando-com-o-mate-framework/</link>
		<comments>http://blog.erkobridee.com/2010/03/10/vedovelli-iniciando-com-o-mate-framework/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 12:32:59 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Vídeo]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Fábio Vedovelli]]></category>
		<category><![CDATA[Mate Framework]]></category>
		<category><![CDATA[Screencast]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=1776</guid>
		<description><![CDATA[O Fábio Vedovelli disponibilizou em seu blog um ScreenCast que a muito tempo estava ansioso para ver, como que ele anda utilizando o Mate Framework para Adobe Flex, 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%2F03%2F10%2Fvedovelli-iniciando-com-o-mate-framework%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F03%2F10%2Fvedovelli-iniciando-com-o-mate-framework%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><img class="aligncenter" src="http://www.vedovelli.com.br/wp-content/uploads/2010/02/bannerMate.png" alt="" /></p>
<p style="text-align: center;"><a href="http://mate.asfusion.com/">http://mate.asfusion.com/</a></p>
<p>O Fábio Vedovelli disponibilizou em seu blog um ScreenCast que a muito tempo estava ansioso para ver, como que ele anda utilizando o Mate Framework para Adobe Flex, confira&#8230;</p>
<p style="text-align: center;"><a href="http://www.vedovelli.com.br/?p=1368">http://www.vedovelli.com.br/?p=1368</a></p>
<p>onde aborda o framework para Adobe Flex – Mate Framework que é uma mão na roda para organizar/desenvolver sistemas com Flex de médio a grande porte pensando em manutenção/expansão futura</p>
<p><br class="spacer_" /></p>
<p>A documentação do framework é no estilo que eu gosto e que o Adobe Flex usa exemplo de código e explicação</p>
<p style="text-align: center;"><a href="http://mate.asfusion.com/page/documentation">http://mate.asfusion.com/page/documentation</a></p>
<p><br class="spacer_" /></p>
<p><strong><em>- Apresentação : Adobe Max 2009 &#8211; Mate Framework</em><span style="font-weight: normal;"> [<a href="http://mate.asfusion.com/assets/content/presentations/mate_max_2009.pdf">PDF</a>]</span></strong></p>
<p><strong><em>- Laura Arguello : Apresentação do Mate Framework no Flex Mania 2009</em></strong> [<a href="http://experts.na3.acrobat.com/p10699734/">assistir</a>] [<a href="http://flexmania.com.br/gravacoes.php">Gravações Flex Mania 2009</a>]</p>
<blockquote><p>Mate é um framework Flex baseado na linguagem MXML que lhe proporciona uma maneira fácil de mapear como a sua aplicação irá tratar os eventos e distribuir os dados. Isto soluciona alguns problemas corriqueiros que nós desenvolvedores encontramos durante a codificação de aplicações em Flex, tanto de aplicações pequenas a empresariais de grande porte, nos auxilia a tanto recuperar dados de serviços externos, quando a tratar a lógica de negócio. Essa apresentação irá lhe mostrar o que é o Mate e como utilizá-lo.</p>
</blockquote>
<p><strong><em> &#8211; Mate Framework + Flex 4 SDK </em><span style="font-weight: normal;">[<a href="http://blog.lyraspace.com/2009/07/28/mate-framework-and-flex-4-sdk/">link post</a>]</span></strong></p>
<p><br class="spacer_" /></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1776&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/02/07/sera-que-eu-devo-aceitar-um-trabalho-em-flex-agora/" title="Será que eu devo aceitar um trabalho em Flex agora?">Será que eu devo aceitar um trabalho em Flex agora?</a></li><li><a href="http://blog.erkobridee.com/2009/02/27/screencast-de-monsterdebugger-fabio-vedovelli/" title="Screencast: De MonsterDebugger : Fábio Vedovelli">Screencast: De MonsterDebugger : Fábio Vedovelli</a></li><li><a href="http://blog.erkobridee.com/2009/02/27/screencast-flexreport-elvis-fernandes/" title="Screencast: Flexreport : Elvis Fernandes">Screencast: Flexreport : Elvis Fernandes</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></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/03/10/vedovelli-iniciando-com-o-mate-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Adobe Flex] Definindo o foco na aplicação</title>
		<link>http://blog.erkobridee.com/2010/02/17/adobe-flex-definindo-o-foco-na-aplicacao/</link>
		<comments>http://blog.erkobridee.com/2010/02/17/adobe-flex-definindo-o-foco-na-aplicacao/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 19:40:08 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Dica]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Focus]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=1502</guid>
		<description><![CDATA[Para facilitar a vida do usuário, quando a aplicação for carregada no HTML, definir o foco no SWF com isto o usuário pode já começara a utilizar a aplicação sem ter a necessidade de clicar na página...]]></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%2F02%2F17%2Fadobe-flex-definindo-o-foco-na-aplicacao%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F02%2F17%2Fadobe-flex-definindo-o-foco-na-aplicacao%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Para facilitar a vida do usuário, quando a aplicação for carregada no HTML, definir o foco no SWF com isto o usuário pode já começara a utilizar a aplicação sem ter a necessidade de clicar na página&#8230;</p>
<blockquote><p>Conversando com o <a href="http://twitter.com/mpbonatti">@mpbonatti</a> <a href="http://blog.mpbonatti.com">[site]</a>, ele me comentou que estava com esta dificuldade e como eu também precisava usar este mesmo recurso, resolvi correr atras, inicialmente havia consegui fazer funcionar apenas no Firefox e no Internet Explorer, depois com uma dica do <a href="http://twitter.com/ericmaicon">@ericmaicon</a> <a href="http://www.ericmaicon.com.br">[site] </a>funcionou nos 3 Web Browsers que realizei o teste, segue&#8230;</p>
</blockquote>
<p><br class="spacer_" /></p>
<p><strong>Como fazer isto?</strong></p>
<p>Utilizar a funcionalidade do <em>ExternalInterface</em> e criar uma function na aplicação Flex, a qual será chamada no evento <em><strong>creationComplete</strong></em> conforme o respectivo exemplo 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('p1502code15'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p150215"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1502code15"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setFocusHtml<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span>
		<span style="color: #ff0000;">&quot;s = function() { window.document.getElementById('&quot;</span>+<span style="color: #0066CC;">this</span>.<span style="color: #006600;">id</span>+<span style="color: #ff0000;">&quot;').focus(); }&quot;</span>
	<span style="color: #66cc66;">&#41;</span>; 
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<blockquote><p>Segundo os testes realizados no Firefox, Internet Explorer e Google Chrome esta solução funcionou&#8230;</p>
</blockquote>
<p><br class="spacer_" /></p>
<p>e para você também funcionou? Comente&#8230;</p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1502&type=feed" alt="" /><h3  class="related_post_title">Veja também:</h3><ul class="related_post"><li><a href="http://blog.erkobridee.com/2010/01/20/adobe-flex-comparando-datas-de-maneira-rapida-e-facil/" title="[Adobe Flex] comparando datas de maneira rápida e fácil">[Adobe Flex] comparando datas de maneira rápida e fácil</a></li><li><a href="http://blog.erkobridee.com/2010/01/20/adobe-flex-gerando-war-sem-os-fontes-no-adobe-flex-builder/" title="[Adobe Flex] gerando .war sem os fontes no Adobe Flex Builder">[Adobe Flex] gerando .war sem os fontes no Adobe Flex Builder</a></li><li><a href="http://blog.erkobridee.com/2008/05/27/google-maps-agora-no-flashflex-finalmente/" title="Google Maps agora no Flash/Flex : finalmente">Google Maps agora no Flash/Flex : finalmente</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/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></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/02/17/adobe-flex-definindo-o-foco-na-aplicacao/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Será que eu devo aceitar um trabalho em Flex agora?</title>
		<link>http://blog.erkobridee.com/2010/02/07/sera-que-eu-devo-aceitar-um-trabalho-em-flex-agora/</link>
		<comments>http://blog.erkobridee.com/2010/02/07/sera-que-eu-devo-aceitar-um-trabalho-em-flex-agora/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 13:02:09 +0000</pubDate>
		<dc:creator>Erko Bridee</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Fábio Vedovelli]]></category>
		<category><![CDATA[Gabriela Trindade Perry]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[Profissional]]></category>

		<guid isPermaLink="false">http://blog.erkobridee.com/?p=1493</guid>
		<description><![CDATA[Recomendo d+ a leitura do Post escrito pela Gabriela Trindade Perry, que fala sobre conhecimento "mínimos" de um profissional para encarar projetos em 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%2F02%2F07%2Fsera-que-eu-devo-aceitar-um-trabalho-em-flex-agora%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erkobridee.com%2F2010%2F02%2F07%2Fsera-que-eu-devo-aceitar-um-trabalho-em-flex-agora%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Recomendo d+ a leitura do Post escrito pela <a href="http://www.gabriela.trindade.nom.br/">Gabriela Trindade Perry</a>, que fala sobre conhecimento &#8220;mínimos&#8221; de um profissional para encarar projetos em Adobe Flex =]</p>
<p><br class="spacer_" /></p>
<p><em><strong>Início do post da Gabriela:</strong></em></p>
<p><em>&#8220;Recentemente houve um debate na FB sobre qual seria um valor justo a se pagar a um programador Flex. A pessoa que começou a thread pode até não ter se dado conta, mas mexeu num vespeiro. Muitas pessoas deram suas opiniões (eu também, lógico!) e parece que o saldo do debate ficou assim&#8230;&#8221;</em></p>
<p><br class="spacer_" /></p>
<p><strong>segue:</strong></p>
<p><a href="http://www.gabriela.trindade.nom.br/2010/02/sera-que-eu-devo-aceitar-um-trabalho-em-flex-agora/">http://www.gabriela.trindade.nom.br/2010/02/sera-que-eu-devo-aceitar-um-trabalho-em-flex-agora/</a></p>
<p><br class="spacer_" /></p>
<p>O <a href="http://www.vedovelli.com.br/">Vedovelli</a> também fez um post de referência para o post da Gabriela:</p>
<p><a href="http://www.vedovelli.com.br/?p=1258">http://www.vedovelli.com.br/?p=1258</a></p>
</div><img src="http://blog.erkobridee.com/?ak_action=api_record_view&id=1493&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/10/vedovelli-iniciando-com-o-mate-framework/" title="[Vedovelli] Iniciando com o Mate Framework">[Vedovelli] Iniciando com o Mate Framework</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-flex-3-5-uploaddownloadblazeds/" title="Adobe Flex 3.5 : UploadDownloadBlazeDS">Adobe Flex 3.5 : UploadDownloadBlazeDS</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></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.erkobridee.com/2010/02/07/sera-que-eu-devo-aceitar-um-trabalho-em-flex-agora/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
