<?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>Igor Costa &#187; Actionscript Frameworks</title>
	<atom:link href="http://www.igorcosta.com/blog/index.php?feed=rss2&#038;cat=48" rel="self" type="application/rss+xml" />
	<link>http://www.igorcosta.com/blog</link>
	<description>Ajudar aos outros da ao sucesso o verdadeiro significado</description>
	<lastBuildDate>Thu, 09 Sep 2010 20:05:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gravação da palestra &#8211; &#8220;Advanced data visualization&#8221; disponível</title>
		<link>http://www.igorcosta.com/blog/?p=920</link>
		<comments>http://www.igorcosta.com/blog/?p=920#comments</comments>
		<pubDate>Wed, 14 Oct 2009 21:10:02 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Eventos]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 3 SDK]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Sexta-Flex Talkshow]]></category>
		<category><![CDATA[Axiis]]></category>
		<category><![CDATA[sextaflex]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=920</guid>
		<description><![CDATA[
			
				
			
		
Quem compareceu ao último sextaflex não pode reclamar, foi excelente o evento e o Michel Vandaniker mandou ver no Axiis para todos os 18 participantes ao total presente no evento on-line.
Caso você por algum motivo que seja perdeu e quer acessar, você pode acessar o link da gavação abaixo.
http://experts.na3.acrobat.com/p38851909/
Obrigado a todos que compareceram.
Nesta semana dia [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D920"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D920&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Quem compareceu ao último sextaflex não pode reclamar, foi excelente o evento e o Michel Vandaniker mandou ver no Axiis para todos os 18 participantes ao total presente no evento on-line.<br />
Caso você por algum motivo que seja perdeu e quer acessar, você pode acessar o link da gavação abaixo.</p>
<p><a href="http://experts.na3.acrobat.com/p38851909/">http://experts.na3.acrobat.com/p38851909/</a></p>
<p>Obrigado a todos que compareceram.</p>
<p>Nesta semana dia 16/10 não haverá sextaflex por motivo de força maior. Não somos muito de reclamar das coisas, mais tem sido bem corrido, em resumo todo mundo decidiu usar Flex de uma única vez e nesse final de ano.</p>
<p>Na próxima semana já temos engatado mais 1 palestrante nacional e vai falar de seus cases e você vai conhecer novas empresas que produzem RIA com qualidade. Queremos mostrar e dar vitrine para todas as minúsculas até as golias das empresas Brasileiras o espaço para ir falando de suas dificuldades e sucessos com a escolha do Flex. Afinal Flex não é só flores.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=920</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Mobile Framework</title>
		<link>http://www.igorcosta.com/blog/?p=917</link>
		<comments>http://www.igorcosta.com/blog/?p=917#comments</comments>
		<pubDate>Tue, 06 Oct 2009 18:55:43 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Mobile Framework]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[Slider Framework]]></category>
		<category><![CDATA[Flex in Mobile]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Slider]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=917</guid>
		<description><![CDATA[
			
				
			
		
Ontem a Adobe oficializou o anúncio que estava trabalhando em uma versão optimizada para dispositivos móveis do Flex SDK.
O Flex Mobile Framework ou melhor Slider é uma grande promessa para então já esperada comunidade de desenvolvedores da plataforma Flex.
Com o recém chegado Flash Player 10 para dispositivos móveis a coisa muda de status e passa [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D917"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D917&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Ontem a Adobe oficializou o anúncio que estava trabalhando em uma versão optimizada para dispositivos móveis do Flex SDK.<br />
O <a href="http://labs.adobe.com/technologies/flex/mobile/">Flex Mobile Framework</a> ou melhor Slider é uma grande promessa para então já esperada comunidade de desenvolvedores da plataforma Flex.</p>
<p>Com o recém chegado Flash Player 10 para dispositivos móveis a coisa muda de status e passa a amadurecer mais ainda esssa idéia de rodar Actionscript 3.0 para celulares.</p>
<p>Em minha opinião pessoal, acredito que há sem dúvida muito trabalho a ser feito para optimizar o Flex SDK para dispositivos móveis, onde os principais desafios são multi-toque, pouca memória disponível e pouco nível de processamento. O que acarreta atualmente na inviabilidade de se rodar isso &#8220;Out of Box&#8221;.</p>
<p>Pesquisas internas rodando o novo Flash Player em meu Nokia e62 serie 60 5th mostrou que ainda tem muito que amadurecer o player para rodar nos dispositivos móveis. Principalmente para o futuro Slider.</p>
<p>Uma biblioteca que se comportou muito bem, fora o aspecto de multi-touch. Não pudemos testar por que não possuo nenhum celular com multi-touch foi o minimal components do Keith. É level, funcional e possui a mesmo fluxo de criação de componentes Flex.<br />
Acredito que Adobe esteja se baseando em sua experiência bem sucessidade em introduzir o Flex em forms do LiveCycle para julgar os melhores aspectos.<br />
Como no<a href="http://download.macromedia.com/pub/labs/flex/mobile/flexmobile_whitepaper.pdf"> próprio whitepaper </a>do Slider há grandes desafiors e com toda certeza ela vai fazer isso rodar suavemente.<br />
Vamos aguardar.</p>
<p>[Atualização 07/10/2009] <a href="http://tv.adobe.com/watch/max-2009-develop/preview-flex-for-mobile-devices/">Video mostrando </a>o Slider em ação.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=917</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sexta-Flex &#8211; Criando visualizações de dados avançados com Axiis</title>
		<link>http://www.igorcosta.com/blog/?p=914</link>
		<comments>http://www.igorcosta.com/blog/?p=914#comments</comments>
		<pubDate>Tue, 06 Oct 2009 02:06:38 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 3 Charts]]></category>
		<category><![CDATA[Flex Componentes]]></category>
		<category><![CDATA[Sexta-Flex Talkshow]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[Axiis]]></category>
		<category><![CDATA[Data Visualization]]></category>
		<category><![CDATA[Open-source]]></category>
		<category><![CDATA[Sexta-Flex]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=914</guid>
		<description><![CDATA[
			
				
			
		

Na próxima sexta-flex, no mesmo horário vamos ter um encontro com o Michael VanDaniker, ele é co-autor do framework open-source que mudou a maneira como dados são exibidos na plataforma Flex.
Se você fica babando por que vê os tão belos feitos do Flex Data Visualization, (charts). Então você precisa conhecer o Axiis.
Veja os detalhes da [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D914"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D914&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.igorcosta.com/blog/wp-content/uploads/2009/10/axiis.jpg" alt="axiis" title="axiis" width="599" height="208" class="alignnone size-full wp-image-915" /></p>
<p>Na próxima sexta-flex, no mesmo horário vamos ter um encontro com o <a href="http://michaelvandaniker.com/blog/">Michael VanDaniker</a>, ele é co-autor do framework open-source que mudou a maneira como dados são exibidos na plataforma Flex.</p>
<p>Se você fica babando por que vê os tão belos feitos do Flex Data Visualization, (charts). Então você precisa conhecer o <a href="http://www.axiis.org">Axiis</a>.<br />
Veja os detalhes da palestra e vê se não perde. Claro que agente entende se você não puder assistir ao vivo, depois ela será gravada.</p>
<p>Palestra On-line<br />
Titulo : Advanced Data Visualization with Axiis<br />
Palestrante: Michel VanDaniker<br />
Horário: Sempre no mesmo horário: das 09:00 AM até as 10:00 horário de Brasília.<br />
Endereço para acesso: <a href="http://experts.na3.acrobat.com/palestras/">http://experts.na3.acrobat.com/palestras/</a><br />
Palestra em inglês.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=914</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sexta-Flex &#8211; Explorando o fator Z com Away3D e Away3D lite com Rob Bateman</title>
		<link>http://www.igorcosta.com/blog/?p=905</link>
		<comments>http://www.igorcosta.com/blog/?p=905#comments</comments>
		<pubDate>Tue, 29 Sep 2009 15:06:54 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Eventos]]></category>
		<category><![CDATA[Sexta-Flex Talkshow]]></category>
		<category><![CDATA[away3D]]></category>
		<category><![CDATA[away3D Lite]]></category>
		<category><![CDATA[Sexta-Flex]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=905</guid>
		<description><![CDATA[
			
				
			
		

Na próxima sexta-feira (2/10) (oops sexta-flex) vamos ter mais um convidado especial que vai falar para nós sobre os seus frameworks Away3D e Away3D Lite. Rob Bateman é londrino e adora o mundo 3D. Ele vai apresentar sobre o framework e como ele pode ajudar a criar ambientes 3D na plataforma Flash.
Palestra: Explorando o fator [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D905"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D905&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.igorcosta.com/blog/wp-content/uploads/2009/09/robbateman.jpg" alt="robbateman" title="robbateman" width="634" height="164" class="alignnone size-full wp-image-907" /><br />
Na próxima sexta-feira (2/10) (oops sexta-flex) vamos ter mais um convidado especial que vai falar para nós sobre os seus frameworks Away3D e Away3D Lite. Rob Bateman é londrino e adora o mundo 3D. Ele vai apresentar sobre o framework e como ele pode ajudar a criar ambientes 3D na plataforma Flash.</p>
<p>Palestra: Explorando o fator Z com Away3D e Away3D Lite<br />
Palestrante: Rob Bateman<br />
Sempre no mesmo horário: das 09:00 AM até as 10:00 horário de Brasília.<br />
Endereço para acesso: <a href="http://experts.na3.acrobat.com/palestras/">http://experts.na3.acrobat.com/palestras/</a><br />
Palestra em inglês.</p>
<p>Conto com todos os meus leitores, seguidores do Twitter e membros das comunidades Brasileiras para participar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=905</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Criando um player de MP3 com Flash CS4 e actionscript 3.0</title>
		<link>http://www.igorcosta.com/blog/?p=769</link>
		<comments>http://www.igorcosta.com/blog/?p=769#comments</comments>
		<pubDate>Mon, 09 Feb 2009 16:00:38 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Flash CS 3]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Flash Componentes]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[SoundTransform]]></category>
		<category><![CDATA[UIComponents]]></category>
		<category><![CDATA[URLRequest]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=769</guid>
		<description><![CDATA[
			
				
			
		
O exemplo abaixo, mostra como criar um player de música em actionscript 3.0 feito com alguns componentes básicos do Flash CS4, aquiles que vem por padrão no Flash CS3 e Flash CS4.
O projeto foi feito usando o Flex Builder, então procure nos arquevos do site como usar os componentes do Flash no Flex Builder.
Na atual [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D769"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D769&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>O exemplo abaixo, mostra como criar um player de música em actionscript 3.0 feito com alguns componentes básicos do Flash CS4, aquiles que vem por padrão no Flash CS3 e Flash CS4.<br />
O projeto foi feito usando o Flex Builder, então procure nos arquevos do site como usar os componentes do Flash no Flex Builder.</p>
<p>Na atual versão do actionscript 3.0 é bem complicado usar a classe de som, para se ter uma idéia, foi necessário usar as classes Sound, SoundChannel,SoundTransform, só para dar o play e controlar o volume.<br />
Em fim, segue abaixo o exemplo:</p>
<p><img src="http://www.igorcosta.com/blog/wp-content/uploads/2009/02/playermp3.jpg" alt="playermp3" title="playermp3" width="417" height="206" class="alignnone size-full wp-image-770" /></p>
<p><strong>Código:</strong></p>

<div class="wp_syntax"><table><tr><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
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> fl.controls.Button;
	<span style="color: #0033ff; font-weight: bold;">import</span> fl.controls.Slider;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.media</span>.<span style="color: #004993;">Sound</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.media</span>.<span style="color: #004993;">SoundTransform</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.media</span>.<span style="color: #004993;">SoundChannel</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> fl.events.SliderEvent;
	<span style="color: #0033ff; font-weight: bold;">import</span> fl.controls.Label;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</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;150&quot;</span>,<span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0xF2F2F2&quot;</span>,<span style="color: #004993;">frameRate</span>=<span style="color: #990000;">&quot;25&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> AS3Player extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> playButton<span style="color: #000000; font-weight: bold;">:</span>Button;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> stopButton<span style="color: #000000; font-weight: bold;">:</span>Button;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> volumeControl<span style="color: #000000; font-weight: bold;">:</span>Slider;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> urlSom<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;mp3/seusom.mp3&quot;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> MP3Request<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> musicaTransform<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">SoundTransform</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> musicaCanal<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">SoundChannel</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> musica<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sound</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> volLabel<span style="color: #000000; font-weight: bold;">:</span>Label;
&nbsp;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> AS3Player<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			MP3Request = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span>urlSom<span style="color: #000000;">&#41;</span>;
&nbsp;
			musica = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sound</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			musica.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>MP3Request<span style="color: #000000;">&#41;</span>;
			musicaCanal = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">SoundChannel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			musicaTransform = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">SoundTransform</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0.5</span>,<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * Montar os botões e Slider para controlar o som
			 * 
			 * playButton - Toca o som;
			 * stopButton - Para o som;
			 * volumeControl - Aumenta e diminue o som;
			 * */</span>
&nbsp;
			playButton = <span style="color: #0033ff; font-weight: bold;">new</span> Button<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			playButton.label = <span style="color: #990000;">&quot;Tocar&quot;</span>;
			playButton.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">10</span>;
			playButton.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>playButton<span style="color: #000000;">&#41;</span>;
			playButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>,SomAction<span style="color: #000000;">&#41;</span>;
&nbsp;
			stopButton = <span style="color: #0033ff; font-weight: bold;">new</span> Button<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			stopButton.label = <span style="color: #990000;">&quot;Parar&quot;</span>;
			stopButton.<span style="color: #004993;">x</span> = playButton.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">20</span>;
			stopButton.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>stopButton<span style="color: #000000;">&#41;</span>;
			stopButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>,SomAction<span style="color: #000000;">&#41;</span>;
&nbsp;
			volumeControl = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			volumeControl.direction = <span style="color: #990000;">&quot;horizontal&quot;</span><span style="color: #009900;">// ou vertical;</span>
			volumeControl.minimum =<span style="color: #000000; font-weight:bold;">0</span>;
			volumeControl.maximum =<span style="color: #000000; font-weight:bold;">1</span>;
			volumeControl.<span style="color: #004993;">doubleClickEnabled</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			volumeControl.tickInterval = .1;
			volumeControl.snapInterval = .1;
			volumeControl.<span style="color: #004993;">value</span> = musicaTransform.<span style="color: #004993;">volume</span>;
			volumeControl.liveDragging = <span style="color: #0033ff; font-weight: bold;">true</span>;
			volumeControl.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">230</span>;
			volumeControl.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>volumeControl<span style="color: #000000;">&#41;</span>;	
			volumeControl.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>SliderEvent.<span style="color: #004993;">CHANGE</span>,VolumeAction<span style="color: #000000;">&#41;</span>;	
&nbsp;
			volLabel = <span style="color: #0033ff; font-weight: bold;">new</span> Label<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			volLabel.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;Volume&quot;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>volLabel<span style="color: #000000;">&#41;</span>;
			volLabel.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">250</span>;
			volLabel.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @public
		 * Controla o volume da música carregada;
		 * */</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> VolumeAction<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span>SliderEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
				musicaTransform.<span style="color: #004993;">volume</span> = volumeControl.<span style="color: #004993;">value</span>;
				musicaCanal.<span style="color: #004993;">soundTransform</span> = musicaTransform;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @public
		 * controla o som, play e stop;
		 * */</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> SomAction<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
&nbsp;
				<span style="color: #6699cc; font-weight: bold;">var</span> posicao<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = musicaCanal.<span style="color: #004993;">position</span>;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>playButton.label == <span style="color: #990000;">&quot;Tocar&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
					playButton.label = <span style="color: #990000;">&quot;Pausa&quot;</span>;
					musicaCanal = musica.<span style="color: #004993;">play</span><span style="color: #000000;">&#40;</span>posicao<span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span><span style="color: #0033ff; font-weight: bold;">else</span><span style="color: #000000;">&#123;</span>
					musicaCanal.<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
					playButton.label = <span style="color: #990000;">&quot;Tocar&quot;</span>;
					musicaCanal.<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=769</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Trabalhando com DataProvider no Flash CS3/CS4</title>
		<link>http://www.igorcosta.com/blog/?p=766</link>
		<comments>http://www.igorcosta.com/blog/?p=766#comments</comments>
		<pubDate>Sat, 07 Feb 2009 04:34:37 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Flash CS3]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=766</guid>
		<description><![CDATA[
			
				
			
		
A sintaxe de programação para se trabalhar com DataProvider no Flash CS3 ou CS4 é um pouco diferente da que estamos acostumados no Flex. Entretanto o funcionamento é o mesmo. 
O exemplo abaixo, popula um controle de ComboBox, e foi feito com Document Class, caso você queria setar um para rodar em sua máquena.
A primeira [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D766"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D766&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>A sintaxe de programação para se trabalhar com DataProvider no Flash CS3 ou CS4 é um pouco diferente da que estamos acostumados no Flex. Entretanto o funcionamento é o mesmo. </p>
<p>O exemplo abaixo, popula um controle de ComboBox, e foi feito com Document Class, caso você queria setar um para rodar em sua máquena.</p>
<p>A primeira coisa que você faz para adicionar dados ao seu controle é justamente criar um objeto DataProvider e setar o source dele para o Array, XML ou coleção de objetos que você tenha. Ele parece muito com o comportamento do ICollectionView do Flex.</p>
<p>Exemplo:</p>

<div class="wp_syntax"><table><tr><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
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span><span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">import</span> fl.controls.ComboBox;
		<span style="color: #0033ff; font-weight: bold;">import</span> fl.<span style="color: #004993;">data</span>.DataProvider;
		<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
		<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;800&quot;</span>,<span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;600&quot;</span>, <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0xcccccc&quot;</span>, <span style="color: #004993;">frameRate</span>=<span style="color: #990000;">'40'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">MovieClip</span> <span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> cbx<span style="color: #000000; font-weight: bold;">:</span>ComboBox;
			<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> arr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #000000;">&#91;</span><span style="color: #990000;">'Sao Paulo'</span>,<span style="color: #990000;">'Recife'</span>,<span style="color: #990000;">'Rio de Janeiro'</span>,<span style="color: #990000;">'Brasilia'</span><span style="color: #000000;">&#93;</span>;
			<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">d</span><span style="color: #000000; font-weight: bold;">:</span>DataProvider = <span style="color: #0033ff; font-weight: bold;">new</span> DataProvider<span style="color: #000000;">&#40;</span>arr<span style="color: #000000;">&#41;</span>;
					cbx = <span style="color: #0033ff; font-weight: bold;">new</span> ComboBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
					cbx.dataProvider = <span style="color: #004993;">d</span>;
					<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>cbx<span style="color: #000000;">&#41;</span>;
					cbx.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">100</span>;
					cbx.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">100</span>;
					cbx.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">CHANGE</span>,selecionado<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> selecionado<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; 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>e.<span style="color: #004993;">target</span>.selectedItem.<span style="color: #004993;">data</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: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=766</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desenho com a Draw API do Actionscript 3.0</title>
		<link>http://www.igorcosta.com/blog/?p=763</link>
		<comments>http://www.igorcosta.com/blog/?p=763#comments</comments>
		<pubDate>Fri, 06 Feb 2009 22:54:08 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[Actionscript3]]></category>
		<category><![CDATA[Draw API]]></category>
		<category><![CDATA[Line]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=763</guid>
		<description><![CDATA[
			
				
			
		
Desenhar com Actionscript é bem engraçado. Tem diferentes tipos de métodos e infinitas aplicações, exemplo disso é a gama de elementos, mascaras que o Flash Player suporta. Usando o Draw API que é uma parte do core-framework do Flash Player, onde existem vários métodos mágicos que faz todo o conjunto.
Usando a criatividade e algumas linhas [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D763"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D763&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Desenhar com Actionscript é bem engraçado. Tem diferentes tipos de métodos e infinitas aplicações, exemplo disso é a gama de elementos, mascaras que o Flash Player suporta. Usando o Draw API que é uma parte do core-framework do Flash Player, onde existem vários métodos mágicos que faz todo o conjunto.</p>
<p>Usando a criatividade e algumas linhas de código, chega-se à um resultado como esse. Clique na área preta e começe a pintar.</p>
<p>
<object width="280" height="280">
<param name="movie" value="http://www.igorcosta.com/as3/as3Howto.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<embed type="application/x-shockwave-flash" width="280" height="280" src="http://www.igorcosta.com/as3/as3Howto.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
<p>Código do exemplo acima.</p>

<div class="wp_syntax"><table><tr><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
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span>.<span style="color: #004993;">Point</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> as3Howto extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> arte<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MovieClip</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> as3Howto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
				arte = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">MovieClip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>arte<span style="color: #000000;">&#41;</span>;
&nbsp;
				<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,iniciar<span style="color: #000000;">&#41;</span>;
				<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">ROLL_OUT</span>,fechar<span style="color: #000000;">&#41;</span>;
				<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_UP</span>,fechar<span style="color: #000000;">&#41;</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> iniciar<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_MOVE</span>,desenhar<span style="color: #000000;">&#41;</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> fechar<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_MOVE</span>,desenhar<span style="color: #000000;">&#41;</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> desenhar<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; 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>e.<span style="color: #004993;">buttonDown</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
						arte.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">8</span>,0xAA0000,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
						arte.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span>.<span style="color: #004993;">mouseX</span>,<span style="color: #004993;">stage</span>.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span>;
						arte.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;						
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=763</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como carregar um arquivo externo no Actionscript 3.0</title>
		<link>http://www.igorcosta.com/blog/?p=761</link>
		<comments>http://www.igorcosta.com/blog/?p=761#comments</comments>
		<pubDate>Fri, 06 Feb 2009 20:16:40 +0000</pubDate>
		<dc:creator>Igor Costa</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Actionscript Frameworks]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[SecurityErrorEvent]]></category>
		<category><![CDATA[URLLoader]]></category>
		<category><![CDATA[URLRequest]]></category>

		<guid isPermaLink="false">http://www.igorcosta.com/blog/?p=761</guid>
		<description><![CDATA[
			
				
			
		
Começando uma nova categoria aqui no site, para desenvolvedores Flash,AIR,Flash, independentemente de framework sendo SDK do Flex ou não.
O Código abaixo, mostra como carregar um arquevo de XML externo, esse arquevo pode ser um arquevo de texto também (txt).

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
package &#123;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.events.SecurityErrorEvent;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
&#160;
	public class as3Howto extends Sprite
	&#123;
&#160;
		public var suaURL:String = &#34;arquevo.xml&#34;;
		public var [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D761"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.igorcosta.com%2Fblog%2F%3Fp%3D761&amp;source=igorcosta&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Começando uma nova categoria aqui no site, para desenvolvedores Flash,AIR,Flash, independentemente de framework sendo SDK do Flex ou não.</p>
<p>O Código abaixo, mostra como carregar um arquevo de XML externo, esse arquevo pode ser um arquevo de texto também (txt).</p>

<div class="wp_syntax"><table><tr><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
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">IOErrorEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">SecurityErrorEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLLoader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> as3Howto extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> suaURL<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;arquevo.xml&quot;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> requesita<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLLoader</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> as3Howto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #009900;">// montar os objetos</span>
&nbsp;
			requesita = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span>suaURL<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">IOErrorEvent</span>.<span style="color: #004993;">IO_ERROR</span>,ioHandler<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">SecurityErrorEvent</span>.<span style="color: #004993;">SECURITY_ERROR</span>,segurancaHandler<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span>,completoHandler<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// inicia o processo</span>
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>requesita<span style="color: #000000;">&#41;</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> ioHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">IOErrorEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; 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>e.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">'<span style="">\n</span>'</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> segurancaHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">SecurityErrorEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; 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;">'Erro de segurança'</span><span style="color: #000000; font-weight: bold;">+</span>e.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">'<span style="">\n</span>'</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> completoHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; 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;">'Carregado com sucesso'</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">'<span style="">\n</span>'</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.igorcosta.com/blog/?feed=rss2&amp;p=761</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
