﻿<?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>Armando Leopoldo Keller &#187; JSFL</title>
	<atom:link href="http://armandokeller.com/blog/category/jsfl/feed/" rel="self" type="application/rss+xml" />
	<link>http://armandokeller.com/blog</link>
	<description>Actionscript, AIR, Python, Engenharia Elétrica....</description>
	<lastBuildDate>Tue, 24 Jan 2012 19:26:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JSFL para converter png e jpg para swf (até 92% de compressão)</title>
		<link>http://armandokeller.com/blog/2008/12/jsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao/</link>
		<comments>http://armandokeller.com/blog/2008/12/jsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 14:22:42 +0000</pubDate>
		<dc:creator>Armando Leopoldo Keller</dc:creator>
				<category><![CDATA[Flash geral]]></category>
		<category><![CDATA[JSFL]]></category>

		<guid isPermaLink="false">http://alkeller.wordpress.com/?p=35</guid>
		<description><![CDATA[JSFL que exporta imagens para swf, realizando uma compressão de até 92% no tamanho dos arquivos.]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://armandokeller.com/blog/2008/12/jsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://armandokeller.com/blog/2008/12/jsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript"><!-- 
		(function() {
		var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
		s.type = 'text/javascript';
		s.async = true;
		s.src = 'http://widgets.digg.com/buttons.js';
		s1.parentNode.insertBefore(s, s1);
		})();
		//-->
		</script><a class="DiggThisButton " href="http://digg.com/submit?url=http%3A%2F%2Farmandokeller.com%2Fblog%2F2008%2F12%2Fjsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao%2F"></a></div><div class="socialize-in-button socialize-in-button-vertical"><div class="delicious-button"><div class="del-top"><span id="35">0</span>saves</div><div class="del-bot"><a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;">Save</a></div></div>
		<script>
			<!-- 
			function displayURL(data) { var urlinfo = data[0]; if (!urlinfo.total_posts) return;document.getElementById('35').innerHTML = urlinfo.total_posts;}
			//-->
		</script>
		<script src = "http://badges.del.icio.us/feeds/json/url/data?url=http://armandokeller.com/blog/2008/12/jsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao/&amp;callback=displayURL"></script></div></div><p>Aproveitando as ferias da faculdade e essa parada de final de ano para trazer mais um JSFL desta vez realmente util.</p>
<p>O que ele faz:</p>
<p>- Abre 3 janelas, a primeira para escolher em que pasta estão as imagens a serem convertidas, a segunda para ver onde vão ser salvos os swf , e a terceira para ver onde vão ser salvos os flas (essa pode ser cancelada caso não precise dos flas)</p>
<p>- Para cada imagem da pasta selecionada na primeira janela, ele vai criar um fla novo, importar a imagem, redimensionar o palco, colocar allowsmooth, e exportar o swf, se optou por salvar so flas, ele ira salvar o fla na pasta selecionada, caso contrario ira fechar o fla e ir para a proxima imagem.</p>
<p>Resultados:</p>
<p>- Com alguns testes que eu fiz nas ultimas semanas a compressão dos arquivos chegou até 92% (isso faz uma boa diferença em qualquer site).</p>
<p>- Está facil de usar, qualquer um consegue usar, pois o jsfl faz tudo praticamente sozinho.</p>
<p>O JSFL:</p>
<p>Salve o codigo a seguir em como um arquivo jsfl:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*
* JSFL para converter imagens para swf
* Importa a imagem em um fla novo, e exporta o swf com a imagem. (redução de até 92% no &quot;peso do arquivo&quot;)
* @author Armando Leopoldo Keller (alkeller@live.de)  http://alkeller.wordpress.com
*
* Quem utilizar esta classe, favor enviar um email para ALKELLER@LIVE.DE com o &quot;peso&quot; das imagens antes e depois de serem exportadas.
*
*/</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> fotosURI <span style="color: #339933;">=</span> fl.<span style="color: #660066;">browseForFolderURL</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Armando Leopoldo Keller(alkeller@live.de)<span style="color: #000099; font-weight: bold;">\n</span> <span style="color: #000099; font-weight: bold;">\n</span>Selecione a pasta das imagens.<span style="color: #000099; font-weight: bold;">\n</span> &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> swfsURI <span style="color: #339933;">=</span> fl.<span style="color: #660066;">browseForFolderURL</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Armando Leopoldo Keller(alkeller@live.de)<span style="color: #000099; font-weight: bold;">\n</span> <span style="color: #000099; font-weight: bold;">\n</span>Selecione a pasta dos swfs.<span style="color: #000099; font-weight: bold;">\n</span> &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> flasURI <span style="color: #339933;">=</span> fl.<span style="color: #660066;">browseForFolderURL</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Armando Leopoldo Keller(alkeller@live.de)<span style="color: #000099; font-weight: bold;">\n</span> <span style="color: #000099; font-weight: bold;">\n</span>Selecione a pasta dos flas.<span style="color: #000099; font-weight: bold;">\n</span> &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> fileMask1 <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;*.png&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> fileMask2 <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;*.jpg&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> list1 <span style="color: #339933;">=</span> FLfile.<span style="color: #660066;">listFolder</span><span style="color: #009900;">&#40;</span>fotosURI <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;/&quot;</span> <span style="color: #339933;">+</span> fileMask1<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;files&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> list2 <span style="color: #339933;">=</span> FLfile.<span style="color: #660066;">listFolder</span><span style="color: #009900;">&#40;</span>fotosURI <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;/&quot;</span> <span style="color: #339933;">+</span> fileMask2<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;files&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> converte<span style="color: #009900;">&#40;</span>list<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> list<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> doc <span style="color: #339933;">=</span> fl.<span style="color: #660066;">createDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		doc.<span style="color: #660066;">importFile</span><span style="color: #009900;">&#40;</span>fotosURI<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #339933;">+</span>list<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> it <span style="color: #339933;">=</span> doc.<span style="color: #660066;">library</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		it.<span style="color: #660066;">quality</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">80</span><span style="color: #339933;">;</span>
		it.<span style="color: #660066;">allowSmoothing</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		doc.<span style="color: #660066;">addItem</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>x<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>y<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>it<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> selecionado <span style="color: #339933;">=</span> doc.<span style="color: #660066;">getTimeline</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">layers</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">frames</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		selecionado.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
		selecionado.<span style="color: #660066;">y</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
		doc.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>selecionado.<span style="color: #660066;">width</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		doc.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>selecionado.<span style="color: #660066;">height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		doc.<span style="color: #660066;">frameRate</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>flasURI<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			fl.<span style="color: #660066;">saveDocument</span><span style="color: #009900;">&#40;</span>doc<span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span>flasURI<span style="color: #339933;">+</span><span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span>list<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.png&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.jpg&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'.fla'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		doc.<span style="color: #660066;">exportSWF</span><span style="color: #009900;">&#40;</span>swfsURI<span style="color: #339933;">+</span><span style="color: #3366CC;">'/'</span><span style="color: #339933;">+</span>list<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.png&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.jpg&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'.swf'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		doc.<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>fotosURI <span style="color: #339933;">&amp;&amp;</span> swfsURI<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>list1.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>converte<span style="color: #009900;">&#40;</span>list1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// png</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>list2.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>converte<span style="color: #009900;">&#40;</span>list2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// jpg</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Você deve selecionar todas as pastas.(a de .flas é opcional)&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Claro que ainda pode ser otimizado, assim que tiver mais tempo quero ver se otimizo ele.</p>
<p>Observaçoes importantes:</p>
<p>- Quando for converter pngs, exporte todos eles como interlaced (faça um batch no photoshop) assim ele não fica perguntando se quer importar como um bitmap flateado.</p>
<p>- Quem utilizar ele, favor mandar um email ou colocar aqui nos comentarios o tamanho dos arquivos convertidos antes e depois de converter (a soma de todos os arquivos) para motivos de estatistica e para ver se ainda tem como reduzir mais sem perder a qualidade da imagem.</p>
<p>Qualquer duvida é só colocar nos comentarios que eu respondo assim que tiver tempo.</p>
]]></content:encoded>
			<wfw:commentRss>http://armandokeller.com/blog/2008/12/jsfl-para-converter-png-e-jpg-para-swf-ate-92-de-compressao/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JSFL para ajustar posiçoes dos itens como campos de texto com pixelFonts(pixel Snapping)</title>
		<link>http://armandokeller.com/blog/2008/07/jsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping/</link>
		<comments>http://armandokeller.com/blog/2008/07/jsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 01:28:55 +0000</pubDate>
		<dc:creator>Armando Leopoldo Keller</dc:creator>
				<category><![CDATA[AS 2.0]]></category>
		<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Flash geral]]></category>
		<category><![CDATA[JSFL]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[pixelSnapping]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://alkeller.wordpress.com/?p=15</guid>
		<description><![CDATA[0savesSave Olá, primeiramente quero dizer que não tenho postado muita coisa no blog devido a falta de tempo, e tambem de conteudo(até se alguem tiver alguma sugestão manda por email ou coloca aqui como comentario que eu farei o possivel para falar sobre o assunto). Hoje a tarde depois de arrumar as posiçoes dezenas de [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://armandokeller.com/blog/2008/07/jsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://armandokeller.com/blog/2008/07/jsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript"><!-- 
		(function() {
		var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
		s.type = 'text/javascript';
		s.async = true;
		s.src = 'http://widgets.digg.com/buttons.js';
		s1.parentNode.insertBefore(s, s1);
		})();
		//-->
		</script><a class="DiggThisButton " href="http://digg.com/submit?url=http%3A%2F%2Farmandokeller.com%2Fblog%2F2008%2F07%2Fjsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping%2F"></a></div><div class="socialize-in-button socialize-in-button-vertical"><div class="delicious-button"><div class="del-top"><span id="15">0</span>saves</div><div class="del-bot"><a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;">Save</a></div></div>
		<script>
			<!-- 
			function displayURL(data) { var urlinfo = data[0]; if (!urlinfo.total_posts) return;document.getElementById('15').innerHTML = urlinfo.total_posts;}
			//-->
		</script>
		<script src = "http://badges.del.icio.us/feeds/json/url/data?url=http://armandokeller.com/blog/2008/07/jsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping/&amp;callback=displayURL"></script></div></div><p>Olá, primeiramente quero dizer que não tenho postado muita coisa no blog devido a falta de tempo, e tambem de conteudo(até se alguem tiver alguma sugestão manda por email ou coloca aqui como comentario que eu farei o possivel para falar sobre o assunto).</p>
<p>Hoje a tarde depois de arrumar as posiçoes dezenas de movieClips para que não distorcessem eu pensei &#8220;por que eu estou fazendo isso? o flash poderia fazer sozinho&#8221;, então criei este JSFL que faz exatamente isto <a title="Pixel Snapping [alk].jsfl" href="http://paginas.terra.com.br/lazer/alksk8/Pixel%20Snapping%20alk.jsfl" target="_blank">(link)</a></p>
<p>OBS: se o link não funcionar copie ele e cole no navegador;</p>
<p>Como utilizar: é só executar.</p>
<p>ele pega todos os itens(movieClip,Button,Graphic,TextField..)  da timeline atual e ajusta  as posiçoes dos mesmos.</p>
<p>para aplicar isto dentro de um movieClip , abra-o e execute o comando dentro do movie;</p>
<p>pra quem não conseguiu abrir o link aqui vai o codigo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Pixel Snapping [alk].jsfl</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
Script criado por Armando Leopoldo Keller(http://alkeller.wordpress.com)
para instalar: só colar este arquivo em C:\Users\nome_do_usuario\AppData\Local\Adobe\Flash CS3\en\Configuration\Commands
obs: este é o caminho no windows vista
*/</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> fl.<span style="color: #660066;">getDocumentDOM</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getTimeline</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">layers</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> layerAtual <span style="color: #339933;">=</span> fl.<span style="color: #660066;">getDocumentDOM</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getTimeline</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">layers</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> layerAtual.<span style="color: #660066;">frames</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> frameAtual <span style="color: #339933;">=</span> layerAtual.<span style="color: #660066;">frames</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> k <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">;</span> k <span style="color: #339933;">&lt;</span> frameAtual.<span style="color: #660066;">elements</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">;</span> k<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> elementoAtual <span style="color: #339933;">=</span> frameAtual.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span>k<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
elementoAtual.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>elementoAtual.<span style="color: #660066;">x</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
elementoAtual.<span style="color: #660066;">y</span> <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>elementoAtual.<span style="color: #660066;">y</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Qualquer coisa é só comentar, ou mandar email que eu respondo.</p>
]]></content:encoded>
			<wfw:commentRss>http://armandokeller.com/blog/2008/07/jsfl-para-ajustar-posicoes-dos-itens-como-campos-de-texto-com-pixelfontspixel-snapping/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

