<?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/"
	>

<channel>
	<title>Marcelo Duende</title>
	<atom:link href="http://www.marceloduende.com.br/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.marceloduende.com.br/blog</link>
	<description>Flash Developer</description>
	<pubDate>Thu, 26 Aug 2010 19:39:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Como trabalhar nos Estados Unidos da America</title>
		<link>http://www.marceloduende.com.br/blog/?p=74</link>
		<comments>http://www.marceloduende.com.br/blog/?p=74#comments</comments>
		<pubDate>Thu, 26 Aug 2010 19:35:38 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[Portfolio]]></category>

		<category><![CDATA[eua]]></category>

		<category><![CDATA[usa]]></category>

		<category><![CDATA[visa o1]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=74</guid>
		<description><![CDATA[Dai pessoal,
Antes te tudo, nao tenho acentos em meu teclado, entao nao reclamem de problemas de ortografia.
Muita gente me pergunta/fala, sobre vir morar nos Estados Unidos da America, pois bem, vou dar aqui algumas dicas e dizer sobre a realidade da coisa toda.
JAMAIS pense -&#8221;Vou pra gringa ficar rico&#8221;, isso basicamente nao existe, vc nao [...]]]></description>
			<content:encoded><![CDATA[<p>Dai pessoal,</p>
<p>Antes te tudo, nao tenho acentos em meu teclado, entao nao reclamem de problemas de ortografia.</p>
<p>Muita gente me pergunta/fala, sobre vir morar nos Estados Unidos da America, pois bem, vou dar aqui algumas dicas e dizer sobre a realidade da coisa toda.</p>
<p>JAMAIS pense -&#8221;Vou pra gringa ficar rico&#8221;, isso basicamente nao existe, vc nao vai ficar milionario, ficar bem sim, mas nao milionario, talvez se voce virar gerente de uma agencia global por aqui, isso vai do teu esforço.</p>
<p>Nunca pense que voce vai poder vir do nada, &#8220;pronto, to aqui&#8221;, nao eh assim que as coisas funcionam, envolve vistos, dinheiro, talento e principalmente, sorte.  NAO TENTE FICAR ILEGAL AQUI, ISSO NAO EXISTE.</p>
<p>Vou contar por cima como que foi o processo comigo, e ver se ajuda voce.</p>
<p>Primeiro, voce precisa de um sponsorship pra tirar o seu visto, isso quer dizer uma agencia/empresa que te contrate e pague o seu visto. Ou voce pode vir como estagiario, mas mesmo assim tem que ter um sponsorship.</p>
<p>Como que funciona o sponsorship? No meu caso, uma agencia me convidou para trabalhar em New York, e pagou meu visto, visto esse chamado O1, para pessoas com capacidades extra-terrestres, o nome eh estranho, mas eh esse mesmo, ainda te chamam de alien aqui, hehe.</p>
<p>Esse visto, definitivamente nao eh facil de se conseguir, eu demorei 7 meses pra juntar toda documentacao necessaria, aonde vc precisa COMPROVAR que vc fez tudo o que diz, prova de premios, cartas recomendacoes, enfim, minha aplicacao ficou em torno de 280 paginas, quase uma biblia.</p>
<p>Feito isso, e aprovado pelos Estados Unidos da America, voce precisa ir ate o consulado geral em SP, RJ ou PE pra validar o teu visto O1, o que eh meio chatinho, pega fila igual todo mundo, nenhum tratamento em especial.</p>
<p>Tudo aprovado, eh soh pegar o aviao e vir pra ca. Porem, voce vai chegar aqui e vai achar&#8230; -Nossa que legal! sim eh legal, estar em NY, turismo da primeira semana, mas o bicho pega igual no Brasil, voce vai ter problemas do dia a dia pra resolver como em qualquer lugar do mundo. E ninguem vai estar te esperando, acredite, ninguem. Ao menos no meu caso, tive que correr com toda documentacao americana, SSN, ID, Driver License, CC e o mais chato, alugar um bom lugar pra morar.</p>
<p>Se voce se acha preparado pra encarar tudo isso, largue seu portfolio por aih, numa dessas uma agencia gosta do teu perfil e tu acaba vindo, nao esqueca de me avisar para tomarmos uma cerveja na Bedford.</p>
<p>Bye bye</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=74</wfw:commentRss>
		</item>
		<item>
		<title>XML Searcher - Zoo Framework</title>
		<link>http://www.marceloduende.com.br/blog/?p=47</link>
		<comments>http://www.marceloduende.com.br/blog/?p=47#comments</comments>
		<pubDate>Tue, 17 Aug 2010 15:04:04 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[AIR]]></category>

		<category><![CDATA[ActionScript 3.0]]></category>

		<category><![CDATA[Zoo Framework]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[search]]></category>

		<category><![CDATA[xml]]></category>

		<category><![CDATA[xmlsearcher]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=47</guid>
		<description><![CDATA[What&#8217;s up guys, as you know, I&#8217;m improving the Zoo Framework with new features to make your development time shorter and easy. For this reason, I created a search engine for your XML files. Lemme explain it to you.
First of all, download the new released Zoo-Framework here http://code.google.com/p/zoo-framework/downloads/detail?name=zoo-framework.zip&#038;can=2&#038;q=#makechanges.
Unzip the pack where you want.
Now create a [...]]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s up guys, as you know, I&#8217;m improving the Zoo Framework with new features to make your development time shorter and easy. For this reason, I created a search engine for your XML files. Lemme explain it to you.</p>
<p>First of all, download the new released Zoo-Framework here <a href="http://code.google.com/p/zoo-framework/downloads/detail?name=zoo-framework.zip&#038;can=2&#038;q=#makechanges">http://code.google.com/p/zoo-framework/downloads/detail?name=zoo-framework.zip&#038;can=2&#038;q=#makechanges</a>.</p>
<p>Unzip the pack where you want.</p>
<p>Now create a new XML file with the follow structure</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('47code5'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('475');">[<span id="475_symbol">-</span>]</a></div><div class="left"><span id="l47code5"><a href="#" onclick="javascript:showCodeTxt('47code5'); return false;">View Code</a>XML</span></div></td></tr><tr class="msgborder" id="475"><td class="code" id="47code5"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;data<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;depth1<span style="font-weight: bold; color: black;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;depth2<span style="font-weight: bold; color: black;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;depth3</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;duende&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;test<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[hehe]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/test<span style="font-weight: bold; color: black;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/depth3<span style="font-weight: bold; color: black;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;depth3<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;day 1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Strengths Fuaihdsashdinder]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;have do be , pa&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[It's cray baby]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;strengths finder , day 1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Strenasdasdgths Finder]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;strengths finder , day 1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Strengths dfsdf  Finder]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;day 1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Strengths Fuaihdsashdinder]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;have do be , pa&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[It's cray baby]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;strengths finder , day 1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Strenasdasdgths Finder]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">searchTag</span>=<span style="color: #ff0000;">&quot;strengths finder , day 1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;desc<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Strengths dfsdf  Finder]]&gt;</span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/desc<span style="font-weight: bold; color: black;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/depth3<span style="font-weight: bold; color: black;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/depth2<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/depth1<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/data<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Once our XML is done, save it with whatever name you want. Now let&#8217;s go to the Flash</p>
<p>Create a new file and save it with whatever name and place that you want. Then, in first frame, open your code editor and let&#8217;s play.</p>
<p>First of all, lets import the class.</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('47code6'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('476');">[<span id="476_symbol">-</span>]</a></div><div class="left"><span id="l47code6"><a href="#" onclick="javascript:showCodeTxt('47code6'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="476"><td class="code" id="47code6"><pre class="actionscript"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">zoo</span>.<span style="color: #006600;">searcher</span>.<span style="color: #006600;">XMLSearcher</span>; <span style="color: #808080; font-style: italic;">// class imported</span></pre></td></tr></table></div>

<p>Now, let&#8217;s load and search for a string inside of our <desc> node.</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('47code7'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('477');">[<span id="477_symbol">-</span>]</a></div><div class="left"><span id="l47code7"><a href="#" onclick="javascript:showCodeTxt('47code7'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="477"><td class="code" id="47code7"><pre class="actionscript">XMLSearcher.<span style="color: #006600;">search</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xml.xml&quot;</span>, <span style="color: #66cc66;">&#123;</span>term:<span style="color: #ff0000;">&quot;ende&quot;</span>, xmlTag:<span style="color: #ff0000;">&quot;desc&quot;</span>, <span style="color: #0066CC;">type</span>:<span style="color: #ff0000;">&quot;node&quot;</span>, deep:<span style="color: #cc66cc;">3</span>, onComplete:returns<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">function</span> returns<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>XMLSearcher.<span style="color: #006600;">searchResults</span> + <span style="color: #ff0000;">&quot; : SEARCHED FOR NODE&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>XMLSearcher.search(<strong>SOURCE</strong>, {term:<strong>TERM_TO_FIND</strong>, xmlTag:<strong>TAG_INSIDE_OF_THE_XML</strong>, type:<strong>TYPE_OF_ELEMENT_TO_SEARCH</strong>, deep:<strong>DEEP_INSIDE_OF_XML</strong>, onComplete:<strong>FUNCTION_TO_EXECUTE</strong>});</p>
<p>Lemme explain better,</p>
<p>SOURCE = url of XML<br />
term = string that you want to find<br />
xmlTag = name of node or attribute to search<br />
type = if you&#8217;re searching for a node, put &#8220;node&#8221;. if you&#8217;re searching for an attribute, put &#8220;attribute&#8221;;<br />
deep = this the most important part and you need to pay attention, this integer sets the deep level inside of the XML<br />
onComplete = call this function to receive the xml father node of the result of your search</p>
<p>You can also search for attributes in same XML</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('47code8'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('478');">[<span id="478_symbol">-</span>]</a></div><div class="left"><span id="l47code8"><a href="#" onclick="javascript:showCodeTxt('47code8'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="478"><td class="code" id="47code8"><pre class="actionscript">XMLSearcher.<span style="color: #006600;">search</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xml.xml&quot;</span>, <span style="color: #66cc66;">&#123;</span>term:<span style="color: #ff0000;">&quot;duende&quot;</span>, xmlTag:<span style="color: #ff0000;">&quot;searchTag&quot;</span>, <span style="color: #0066CC;">type</span>:<span style="color: #ff0000;">&quot;attribute&quot;</span>, deep:<span style="color: #cc66cc;">2</span>, onComplete:returns2<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">function</span> returns2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>XMLSearcher.<span style="color: #006600;">searchResults</span> + <span style="color: #ff0000;">&quot; : SEARCHED FOR ATTRIBUTE &quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Thoughts? Send me an issue in </p>
<p><a href="http://code.google.com/p/zoo-framework/">http://code.google.com/p/zoo-framework/issues/list</a></p>
<p>Bye bye!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=47</wfw:commentRss>
		</item>
		<item>
		<title>Entendendo override functions AS3</title>
		<link>http://www.marceloduende.com.br/blog/?p=44</link>
		<comments>http://www.marceloduende.com.br/blog/?p=44#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:04:58 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[Portfolio]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[function]]></category>

		<category><![CDATA[override]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=44</guid>
		<description><![CDATA[Yo yo parceiros do Flash. 
Todo mundo me pergunta o porque de se usar uma funcao override em AS3, seguido eu ouço isso. pois bem se ouvir denovo vou mandar pra esse link, vou mostrar de forma rapida um lance que eu fiz pra por no meu framework e que eh bem util.
Conceito.
Functions override servem, [...]]]></description>
			<content:encoded><![CDATA[<p>Yo yo parceiros do Flash. </p>
<p>Todo mundo me pergunta o porque de se usar uma funcao override em AS3, seguido eu ouço isso. pois bem se ouvir denovo vou mandar pra esse link, vou mostrar de forma rapida um lance que eu fiz pra por no meu framework e que eh bem util.</p>
<p>Conceito.</p>
<p>Functions override servem, como o nome diz, para sobrepor alguma funcao existente e deixar de acordo com a nossa necessidade. Vou mostrar no exemplo a baixo.</p>
<p>Usabilidade.</p>
<p>Nao sei por que diabos a Adobe nao fez o nextFrame(); quando chegar no ultimo frame de nossa timeline, fazer voltar para o primeiro frame, seria muito mais facil de controlar nosso filme, mas enfim, vamos fazer o nosso loop acontecer com o nextFrame();</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('44code10'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('4410');">[<span id="4410_symbol">-</span>]</a></div><div class="left"><span id="l44code10"><a href="#" onclick="javascript:showCodeTxt('44code10'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="4410"><td class="code" id="44code10"><pre class="actionscript">&nbsp;
package com.<span style="color: #006600;">zoo</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * @author Marcelo Duende
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TimelineLoop <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_target</span>:<span style="color: #0066CC;">MovieClip</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TimelineLoop<span style="color: #66cc66;">&#40;</span>$target:<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">_target</span> = $target;
		<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* Aqui notem que estou usando a override e chamo o metodo nextFrame(), dentro dele ponho um novo calculo para ele saber oq ue deve fazer, no caso, voltar para o primeiro frame caso esteja no ultimo */</span>
		override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">nextFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_target</span>.<span style="color: #006600;">currentFrame</span> == <span style="color: #0066CC;">_target</span>.<span style="color: #006600;">totalFrames</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">_target</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">_target</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_target</span>.<span style="color: #006600;">currentFrame</span> + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> nativeNextFrame<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">nextFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Batuta ne? Sem segredo e rapidao, se quiser ver mais&#8230; </p>
<p>http://code.google.com/p/zoo-framework/source/browse/zoo-framework/src/com/zoo/TimelineLoop.as</p>
<p>Ai tem a @usage dele bem certinho.</p>
<p>Um abraco e bom estudo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=44</wfw:commentRss>
		</item>
		<item>
		<title>Zoo Framework SoundPlayer feature</title>
		<link>http://www.marceloduende.com.br/blog/?p=39</link>
		<comments>http://www.marceloduende.com.br/blog/?p=39#comments</comments>
		<pubDate>Thu, 08 Oct 2009 18:52:44 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[ActionScript 3.0]]></category>

		<category><![CDATA[Zoo Framework]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=39</guid>
		<description><![CDATA[Definition
Use to create your own playlist or just make your soundFX loops.

[Copy to clipboard][-]View CodeACTIONSCRIPTimport Zoo.SoundPlayer;
SoundPlayer.Init&#40;$url, &#123; $vars &#125;&#41;;

Parameters
$url = The object to be defined to be a own url;
$vars = Here, we can get both loop, fadeIn, fadeOut, fadeInOut, volume, autoPlay and id.
loop = Here we can set the times that own sound will [...]]]></description>
			<content:encoded><![CDATA[<p>Definition</p>
<p>Use to create your own playlist or just make your soundFX loops.</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('39code14'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('3914');">[<span id="3914_symbol">-</span>]</a></div><div class="left"><span id="l39code14"><a href="#" onclick="javascript:showCodeTxt('39code14'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="3914"><td class="code" id="39code14"><pre class="actionscript"><span style="color: #0066CC;">import</span> Zoo.<span style="color: #006600;">SoundPlayer</span>;
SoundPlayer.<span style="color: #006600;">Init</span><span style="color: #66cc66;">&#40;</span>$url, <span style="color: #66cc66;">&#123;</span> $vars <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Parameters</p>
<p>$url = The object to be defined to be a own url;</p>
<p>$vars = Here, we can get both loop, fadeIn, fadeOut, fadeInOut, volume, autoPlay and id.</p>
<p>loop = Here we can set the times that own sound will be played;</p>
<p>fadeIn, fadeOut, fadeInOut = Here we can set fades to own sound, the parameter of this property is &#8220;true&#8221;;</p>
<p>volume = This feature set own volume, this unit is measured between 0 and 1, if you want to set middle of volume uses 0.5;</p>
<p>autoPlay = Just to set if the sounds starts playing or no, the parameter of this one is &#8220;true&#8221;;</p>
<p>id = With own &#8220;id&#8221; we can control own sound, able to play and stop in specific sound.</p>
<p>We can control own sound by id&#8217;s that we set before;</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('39code15'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('3915');">[<span id="3915_symbol">-</span>]</a></div><div class="left"><span id="l39code15"><a href="#" onclick="javascript:showCodeTxt('39code15'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="3915"><td class="code" id="39code15"><pre class="actionscript">SoundPlayer.<span style="color: #0066CC;">Control</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;sound1&quot;</span>, <span style="color: #66cc66;">&#123;</span>command:<span style="color: #ff0000;">&quot;play&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;        
SoundPlayer.<span style="color: #0066CC;">Control</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;all&quot;</span>, <span style="color: #66cc66;">&#123;</span>command:<span style="color: #ff0000;">&quot;stop&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>&#8220;sound1&#8243; = This os own ID that we already set before; &#8220;all&#8221; = This os own property to stop all sounds; command = This is oun method to execute the action, we can put &#8220;play&#8221; and &#8220;stop&#8221; properties;<br />
E.g.</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('39code16'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('3916');">[<span id="3916_symbol">-</span>]</a></div><div class="left"><span id="l39code16"><a href="#" onclick="javascript:showCodeTxt('39code16'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="3916"><td class="code" id="39code16"><pre class="actionscript">SoundPlayer.<span style="color: #006600;">Init</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myMusic.mp3&quot;</span>, <span style="color: #66cc66;">&#123;</span>loop:<span style="color: #cc66cc;">0</span>, fadeInOut:<span style="color: #000000; font-weight: bold;">true</span>, volume:<span style="color: #cc66cc;">1</span>, autoPlay:<span style="color: #000000; font-weight: bold;">false</span>, id:<span style="color: #ff0000;">&quot;sound1&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// to play own id &quot;sound1&quot;;</span>
SoundPlayer.<span style="color: #0066CC;">Control</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;sound1&quot;</span>, <span style="color: #66cc66;">&#123;</span>command:<span style="color: #ff0000;">&quot;play&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// or to stop it</span>
SoundPlayer.<span style="color: #0066CC;">Control</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;all&quot;</span>, <span style="color: #66cc66;">&#123;</span>command:<span style="color: #ff0000;">&quot;stop&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>To download it, click here  http://code.google.com/p/zoo-framework/downloads/list</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=39</wfw:commentRss>
		</item>
		<item>
		<title>Aligner feature tutorial</title>
		<link>http://www.marceloduende.com.br/blog/?p=33</link>
		<comments>http://www.marceloduende.com.br/blog/?p=33#comments</comments>
		<pubDate>Fri, 02 Oct 2009 03:11:34 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[ActionScript 3.0]]></category>

		<category><![CDATA[Zoo Framework]]></category>

		<category><![CDATA[aligner zoo framework actionscript]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=33</guid>
		<description><![CDATA[Hi everyone, if you want to know more about this feature in Zoo ActionScript Framework, download the screencast to see the tutorial.
http://www.marceloduende.com.br/zoo/screencast/Aligner.wmv
Cheers
]]></description>
			<content:encoded><![CDATA[<p>Hi everyone, if you want to know more about this feature in Zoo ActionScript Framework, download the screencast to see the tutorial.</p>
<p><a href="http://www.marceloduende.com.br/zoo/screencast/Aligner.wmv">http://www.marceloduende.com.br/zoo/screencast/Aligner.wmv</a></p>
<p>Cheers</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=33</wfw:commentRss>
<enclosure url="http://www.marceloduende.com.br/zoo/screencast/Aligner.mov" length="5636645" type="video/quick" />
		</item>
		<item>
		<title>Zoo Framework</title>
		<link>http://www.marceloduende.com.br/blog/?p=28</link>
		<comments>http://www.marceloduende.com.br/blog/?p=28#comments</comments>
		<pubDate>Wed, 16 Sep 2009 01:16:23 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=28</guid>
		<description><![CDATA[Zoo ActionScript Framework was born to make your life easier in a shorter time of development.
Zoo is still a kid but, it has some interesting features such as Aligner, CharacterReplacer and new funcionality being created.
The objective of Zoo is to create a huge framework, integrating actionscript with some others programming languages like Java and PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Zoo ActionScript Framework was born to make your life easier in a shorter time of development.</p>
<p>Zoo is still a kid but, it has some interesting features such as Aligner, CharacterReplacer and new funcionality being created.</p>
<p>The objective of Zoo is to create a huge framework, integrating actionscript with some others programming languages like Java and PHP and also making things work in Flash by itself.</p>
<p>Zoo is free, I’ll NEVER charge anything for it. Is an open source code, all documented.</p>
<p>You can check it out in&#8230;<br />
<a href="http://code.google.com/p/zoo-framework/">http://code.google.com/p/zoo-framework/</a></p>
<p>Cheers</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=28</wfw:commentRss>
		</item>
		<item>
		<title>FlexMania - 06 e 07 de 2009</title>
		<link>http://www.marceloduende.com.br/blog/?p=26</link>
		<comments>http://www.marceloduende.com.br/blog/?p=26#comments</comments>
		<pubDate>Sat, 27 Jun 2009 16:39:39 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[Hotsite]]></category>

		<category><![CDATA[hotsite desenvolvimento flexmania]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=26</guid>
		<description><![CDATA[Dai pessoal.
Nos dias 06 e 07 de julho, vai ser realizado o Flex Mania, um evento com nomes carimbados do cenário. Cenário esse que vem crescendo e crescendo a cada dia. Eu como colaborador para que isso aconteça, estarei palestrando sobre desenvolvimento e estruturação de hotsites.
Irei falar desde o conceito e um motivo de porque [...]]]></description>
			<content:encoded><![CDATA[<p>Dai pessoal.</p>
<p>Nos dias 06 e 07 de julho, vai ser realizado o Flex Mania, um evento com nomes carimbados do cenário. Cenário esse que vem crescendo e crescendo a cada dia. Eu como colaborador para que isso aconteça, estarei palestrando sobre desenvolvimento e estruturação de hotsites.<br />
Irei falar desde o conceito e um motivo de porque ter um hotsite até a partes técnicas de estruturação de arquivos e melhor forma de se programar tal.<br />
Então não custa nada dar uma averiguada no <a href="http://www.flexmania.com.br">www.flexmania.com.br</a>, conto com vocês pessoal. Abraço e até lá.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=26</wfw:commentRss>
		</item>
		<item>
		<title>Upgrade profissional</title>
		<link>http://www.marceloduende.com.br/blog/?p=19</link>
		<comments>http://www.marceloduende.com.br/blog/?p=19#comments</comments>
		<pubDate>Mon, 05 Jan 2009 03:40:55 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=19</guid>
		<description><![CDATA[Pois é, é isso mesmo, para quem não sabe, estou trocando Curitiba pelo Rio de Janeiro. Trocando de agência, e trocando de vida. Mudanças fazem bem, ainda mais se falando que 2008 não foi um dos melhores anos pra mim.
Mas só para deixar o registro, estou indo trabalhar na Seagulls Fly, agência renomada no meio [...]]]></description>
			<content:encoded><![CDATA[<p>Pois é, é isso mesmo, para quem não sabe, estou trocando Curitiba pelo Rio de Janeiro. Trocando de agência, e trocando de vida. Mudanças fazem bem, ainda mais se falando que 2008 não foi um dos melhores anos pra mim.</p>
<p>Mas só para deixar o registro, estou indo trabalhar na Seagulls Fly, agência renomada no meio do 3D no Brasil. Quem nunca viu o comercial em que Gisele Bundchen enchia o corpo de tatuagens vivas? Ou a fabulosa fábrica da Volkswagen? Pois é, vou me juntar a equipe dos caras, integrar a parte de Actionscript ao lado de Thalles Freitas, flash developer residente.</p>
<p>Vai ser ótimo para o desenvolvimento de técinas com patterns e poliformismo. Também como papervision 3d entre outras. Acredito que é o passo certo no momento certo.</p>
<p><a href="http://www.seagullsfly.com" target="_blank"><img src="http://www.marceloduende.com.br/blog/wp-content/uploads/2009/01/01.jpg" alt="Home Seagulls Fly" title="Home Seagulls Fly" width="300" height="196" class="alignleft size-full wp-image-20" /></a>Para quem não conhece a Seagulls vale a pena dar uma olhada no site da agência, é bem interessante.</p>
<p>Mas por hora é isso, prometo que em 2009 vou dar um pouco mais de atenção para o blog <img src='http://www.marceloduende.com.br/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Grande abraço, paz e ótimo 2009 para todos nós.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
		<item>
		<title>Video Player - AS3</title>
		<link>http://www.marceloduende.com.br/blog/?p=17</link>
		<comments>http://www.marceloduende.com.br/blog/?p=17#comments</comments>
		<pubDate>Fri, 24 Oct 2008 13:00:54 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[ActionScript 3.0]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[netStream]]></category>

		<category><![CDATA[video player]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=17</guid>
		<description><![CDATA[Dai pessoal,
Fiquei offline do blog por um tempo, muita correria, como acontece com todos hehe. Mas venho aqui novamente mostrar como se fazer um player de vídeo com netStream.
Não é nada cabuloso de outro mundo. Vamos resolver essa.
Primeiro baixe a classe TweenMax para transições e algumas animaçõeszinhas, dezipe o arquivo na pasta que vai conter [...]]]></description>
			<content:encoded><![CDATA[<p>Dai pessoal,</p>
<p>Fiquei offline do blog por um tempo, muita correria, como acontece com todos hehe. Mas venho aqui novamente mostrar como se fazer um player de vídeo com netStream.<br />
Não é nada cabuloso de outro mundo. Vamos resolver essa.</p>
<p>Primeiro baixe a classe <a href="http://blog.greensock.com/tweenmaxas3/" title="TweenMax" target="_blank">TweenMax</a> para transições e algumas animaçõeszinhas, dezipe o arquivo na pasta que vai conter o seu fla.</p>
<p>Crie uma pasta contents e dentro dela insira o seu flv com o nome 01.flv.</p>
<p>Agora crie um arquivo novo no flash com 322 x 246, 30 fps, com o nome de videoPlayer.fla . Crie o seu player da forma que achar mais bunito, mas seguindo esses padrões.</p>
<p>1 - Primeiro de tudo crie um MC pai com o instance name de &#8220;video_mc&#8221;, dentro dele que ficará todo nosso player, isso para facilitar o manuseio depois pra algum projeto.</p>
<p>2 - Botão play e pause = Ficam no mesmo botão, pause no primeiro frame, e play no segundo frame. Instance name de &#8220;play_mc&#8221;.</p>
<p>3 - Botão stop = Instance name de &#8220;stop_mc&#8221;.</p>
<p>4 - Botão volume =     Um botão para o setar o volume e o mute, primeiro frame dele o volume ok e no segundo o mute. Instance name de &#8220;volume_mc&#8221;.</p>
<p>5 - Botão SeekDrag = Cuidado aqui, o register point do video_mc tem que ficar exatamente no ponto de início do seekDrag, isso para o cálculo que vamos precisar executar depois. O seu instance name é &#8220;dragSeekBar_mc&#8221;.</p>
<p>6 - ProgressBar = Mesmo princípio do SeekDrag, seu instance name é &#8220;progressBar_mc&#8221;. Seu register point tem que ser alinhado a direita.</p>
<p>7 - Aqui já temos o primeiro macetinho, temos que criar uma máscara para fazer o progress &#8220;andar&#8221;, então crie duas camadas acima da camada do ProgressBar, na primeira use um shape exatamente no mesmo tamanho width do ProgressBar transforme-o em Mc e de o instance name de &#8220;maskProgress_mc&#8221;. Seu register point tem que ser alinhado a direita.</p>
<p>Na outra camada ponha o progreesBar em outra cor, diferenciando o que rodou e o que tem pra ser rodado, transforme em máscara e feito.</p>
<p>8 - Agora vamos adicionar nosso video source no stage, vá na library, bem em baixo, ao lado da lixeirinha, clique com o botão direito e vá até new Video, como name ponha &#8220;player_ns&#8221;. Adicione ele no stage, arrastando da library.</p>
<p>9 - E por útlimo o botão play do inicio do player. Uma camada por cima de tudo com o instance name de &#8220;startVideo_mc&#8221;, e dentro desse mc o botão play com o instance name de &#8220;play_mc&#8221;.</p>
<p>Ufa, fechamos a parte de layout. Quem disse que é facinho? hehe</p>
<p>Bom, se você seguiu todos os passos acima corretamente, é hora de irmos para o code, que inclusive já está bemmmm comentado, para isso abra um arquivo de actionscript novo e o nomeie de videoPlayer.as</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('17code18'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('1718');">[<span id="1718_symbol">-</span>]</a></div><div class="left"><span id="l17code18"><a href="#" onclick="javascript:showCodeTxt('17code18'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="1718"><td class="code" id="17code18"><pre class="actionscript">&nbsp;
package 
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #0066CC;">NetConnection</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #0066CC;">NetStream</span>;
	<span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">TweenMax</span>;
	<span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">easing</span>.<span style="color: #006600;">*</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #006600;">SoundTransform</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Rectangle</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">LoaderInfo</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLLoader</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	* ...
	* @author Duende
	* @link http://www.marceloduende.com.br
	*/</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> videoPlayer <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">//*************************************************************</span>
		<span style="color: #808080; font-style: italic;">//</span>
		<span style="color: #808080; font-style: italic;">// !!!!!!!!!!!!!!!!!!!!!NetStream!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span>
		<span style="color: #808080; font-style: italic;">//</span>
		<span style="color: #808080; font-style: italic;">//*************************************************************</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">Duration</span>:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">15000</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> actualTime:<span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> actualLength:<span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">setVolume</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> rectArea:Rectangle = <span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">107</span>, <span style="color: #cc66cc;">186</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> dragTime:<span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> urlXML:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> urlString:<span style="color: #0066CC;">String</span>  = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> customClient:<span style="color: #0066CC;">Object</span> = <span style="color: #66cc66;">&#123;</span>onMetaData:metaDataHandler<span style="color: #66cc66;">&#125;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> st:SoundTransform = <span style="color: #000000; font-weight: bold;">new</span> SoundTransform<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">netConnection</span>:<span style="color: #0066CC;">NetConnection</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">netStream</span>:<span style="color: #0066CC;">NetStream</span>;
&nbsp;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> videoPlayer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
&nbsp;
&nbsp;
			urlString = <span style="color: #ff0000;">&quot;contents/01.flv&quot;</span>;
			<span style="color: #0066CC;">netConnection</span>.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetStream</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">netConnection</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			video_mc.<span style="color: #006600;">player_ns</span>.<span style="color: #006600;">attachNetStream</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">netStream</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span>urlString<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">seek</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #006600;">client</span> = customClient;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #006600;">soundTransform</span> = st;
			st.<span style="color: #006600;">volume</span> = <span style="color: #cc66cc;">1</span>;
&nbsp;
			video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, PauseVideo<span style="color: #66cc66;">&#41;</span>;
			video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			video_mc.<span style="color: #006600;">stop_mc</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, StopVideo<span style="color: #66cc66;">&#41;</span>;
			video_mc.<span style="color: #006600;">stop_mc</span>.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			video_mc.<span style="color: #006600;">volume_mc</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, SetVolumeVideo<span style="color: #66cc66;">&#41;</span>;
			video_mc.<span style="color: #006600;">volume_mc</span>.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			video_mc.<span style="color: #006600;">dragSeekBar_mc</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, DragSeek<span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> metaDataHandler<span style="color: #66cc66;">&#40;</span>infoObject:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">Duration</span> = infoObject.<span style="color: #0066CC;">duration</span>;
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, DragSeekBar<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		* ...
		* @usage Play/Pause Video
		*/</span>
&nbsp;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> PauseVideo<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #006600;">currentFrame</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> 
			<span style="color: #66cc66;">&#123;</span>
				video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
				video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span>urlString<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">seek</span><span style="color: #66cc66;">&#40;</span>actualTime<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		* ...
		* @usage Stop Video
		*/</span>
&nbsp;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> StopVideo<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			video_mc.<span style="color: #006600;">dragSeekBar_mc</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, DragSeekBar<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">seek</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
			video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
			video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, PauseVideo<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		* ...
		* @usage Set Volume Video
		*/</span>
&nbsp;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> SetVolumeVideo<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>video_mc.<span style="color: #006600;">volume_mc</span>.<span style="color: #006600;">currentFrame</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> 
			<span style="color: #66cc66;">&#123;</span>
				addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, FadeVolume<span style="color: #66cc66;">&#41;</span>;
				video_mc.<span style="color: #006600;">volume_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
				addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, FadeVolume<span style="color: #66cc66;">&#41;</span>;
				video_mc.<span style="color: #006600;">volume_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> FadeVolume<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>video_mc.<span style="color: #006600;">volume_mc</span>.<span style="color: #006600;">currentFrame</span> == <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> 
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">setVolume</span> -= <span style="color: #cc66cc;">0.1</span>;
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">setVolume</span> &lt;= <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">setVolume</span> = <span style="color: #cc66cc;">0</span>;
					removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, FadeVolume<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">setVolume</span> += <span style="color: #cc66cc;">0.1</span>;
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">setVolume</span> &gt;= <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">setVolume</span> = <span style="color: #cc66cc;">1</span>;
					removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, FadeVolume<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			st.<span style="color: #006600;">volume</span> = <span style="color: #0066CC;">setVolume</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #006600;">soundTransform</span> = st;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		* ...
		* @usage Drag Seek Bar
		*/</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> DragSeekBar<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			actualTime = <span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">time</span>;
			video_mc.<span style="color: #006600;">dragSeekBar_mc</span>.<span style="color: #006600;">x</span> = actualTime / <span style="color: #0066CC;">Duration</span> * video_mc.<span style="color: #006600;">progressBar_mc</span>.<span style="color: #0066CC;">width</span>;
			video_mc.<span style="color: #006600;">maskProgress_mc</span>.<span style="color: #006600;">scaleX</span> = actualTime / <span style="color: #0066CC;">Duration</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> DragSeek<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, DragSeekBar<span style="color: #66cc66;">&#41;</span>;
			addEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, DragSeekOut<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">e</span>.<span style="color: #006600;">currentTarget</span>.<span style="color: #0066CC;">startDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span>, rectArea<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> DragSeekOut<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			video_mc.<span style="color: #006600;">play_mc</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			dragTime = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>video_mc.<span style="color: #006600;">dragSeekBar_mc</span>.<span style="color: #006600;">x</span> / video_mc.<span style="color: #006600;">progressBar_mc</span>.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#41;</span> * <span style="color: #0066CC;">Duration</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">e</span>.<span style="color: #006600;">currentTarget</span>.<span style="color: #0066CC;">stopDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			removeEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, DragSeekOut<span style="color: #66cc66;">&#41;</span>;
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, DragSeekBar<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span>urlString<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">netStream</span>.<span style="color: #0066CC;">seek</span><span style="color: #66cc66;">&#40;</span>dragTime<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Ok, estamos com tudo em cima, agora é só definir o classPath, no flash na barra properties, insira videoPlayer e o flash vai achar automaticamente sua classe. Agora só compilar e correr pro abraço</p>

<object	type="application/x-shockwave-flash"
			data="http://www.marceloduende.com.br/blog/arquivos/videoPlayer/videoPlayer.swf"
			width="322"
			height="246">
	<param name="movie" value="http://www.marceloduende.com.br/blog/arquivos/videoPlayer/videoPlayer.swf" />
</object>
<p>Fico perdido? Dessa vez eu libero o fonte, pega <a href="http://www.marceloduende.com.br/blog/arquivos/videoPlayer/videoPlayer.rar" title="aqui" target="_blank">aqui </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=17</wfw:commentRss>
		</item>
		<item>
		<title>Função Genérica</title>
		<link>http://www.marceloduende.com.br/blog/?p=16</link>
		<comments>http://www.marceloduende.com.br/blog/?p=16#comments</comments>
		<pubDate>Thu, 10 Jul 2008 14:06:34 +0000</pubDate>
		<dc:creator>Marcelo Duende</dc:creator>
		
		<category><![CDATA[ActionScript 3.0]]></category>

		<guid isPermaLink="false">http://www.marceloduende.com.br/blog/?p=16</guid>
		<description><![CDATA[Buenas, hoje eu e meu companheiro de trabalho e amigo Paulo Araujo, tivemos uma esncrenca pra resolver, mas resolvemo bem, uma função que recebesse qualquer tipo de valor, pois então desenvolvemos a classe abaixo.
Não vou ensinar mais passo a passo como colocar a classe para rodar no flash né, nos posts anteriores tem como, caso [...]]]></description>
			<content:encoded><![CDATA[<p>Buenas, hoje eu e meu companheiro de trabalho e amigo Paulo Araujo, tivemos uma esncrenca pra resolver, mas resolvemo bem, uma função que recebesse qualquer tipo de valor, pois então desenvolvemos a classe abaixo.</p>
<p>Não vou ensinar mais passo a passo como colocar a classe para rodar no flash né, nos posts anteriores tem como, caso haja alguma dúvida.</p>

<div class="wp_codebox"><table width="100%" align="center"><tr><td colspan="2" class="msgheader"><div class="right"><a href="###" class="smalltxt" onclick="copycode($('16code20'));">[Copy to clipboard]</a><a class="smalltxt" href="###" onclick="toggle_collapse('1620');">[<span id="1620_symbol">-</span>]</a></div><div class="left"><span id="l16code20"><a href="#" onclick="javascript:showCodeTxt('16code20'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr class="msgborder" id="1620"><td class="code" id="16code20"><pre class="actionscript">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;
	<span style="color: #808080; font-style: italic;">/**
	* ...
	* @Marcelo Duende, Paulo Araujo Generic Function
	*/</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span>  genericFunction <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">array</span>:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span>, <span style="color: #ff0000;">&quot;lala&quot;</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">number</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">string</span>:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Duende&quot;</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> genericFunction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			Receive<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">array</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #808080; font-style: italic;">//chamando a ação</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> Receive<span style="color: #66cc66;">&#40;</span>geral:*<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> tipo = <span style="color: #0066CC;">typeof</span> geral;
			<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>tipo<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;object&quot;</span>:
					<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>geral is <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
						<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Array&quot;</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i&lt;geral.<span style="color: #0066CC;">length</span>;i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
							<span style="color: #0066CC;">trace</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">typeof</span> geral<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #66cc66;">&#125;</span>
					<span style="color: #66cc66;">&#125;</span>
					<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>geral is DisplayObject<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
						<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;DisplayObject&quot;</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>geral is Sprite<span style="color: #66cc66;">&#41;</span> <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Sprite&quot;</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>geral is <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#41;</span> <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;MovieClip&quot;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #66cc66;">&#125;</span>
					<span style="color: #b1b100;">else</span> <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Outro tipo de Objeto&quot;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">break</span>;
				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;number&quot;</span>:
					<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>tipo<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">break</span>;
				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;string&quot;</span>:
					<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>tipo<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">break</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Abraço a todos</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceloduende.com.br/blog/?feed=rss2&amp;p=16</wfw:commentRss>
		</item>
	</channel>
</rss>
