<?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>刻录时光 &#187; Flash</title>
	<atom:link href="http://azure.cn/archives/category/development/flash/feed" rel="self" type="application/rss+xml" />
	<link>http://azure.cn</link>
	<description>时光飞逝，莫让网络蹉跎了岁月</description>
	<lastBuildDate>Tue, 03 May 2011 07:31:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>设置 wmode 后 Firefox 中有时按钮失灵</title>
		<link>http://azure.cn/archives/5</link>
		<comments>http://azure.cn/archives/5#comments</comments>
		<pubDate>Fri, 23 Oct 2009 17:56:49 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/10/24/%e8%ae%be%e7%bd%aeWmode%e5%90%8eFirefox%e4%b8%ad%e6%9c%89%e6%97%b6%e6%8c%89%e9%92%ae%e5%a4%b1%e7%81%b5.aspx</guid>
		<description><![CDATA[我的博客中至少记录了2篇关于设置 wmode 后 Firefox 中 flash 有问题的文章，这次又发现了一个，当页面长度超过1屏，点击 flash 区域让 flash 获得焦点，然后滚动页面，如果不再次点击 flash 区域，按钮的 mouseOver 事件就不响应，去掉 wmode 后就没问题了，并且用 swfobject2.2 嵌入 flash 后也没有 flash 边缘恼人的虚线了。所以如果没有必绝对不要用 wmode。
]]></description>
			<content:encoded><![CDATA[<p>我的博客中至少记录了2篇关于设置 wmode 后 Firefox 中 flash 有问题的文章，这次又发现了一个，当页面长度超过1屏，点击 flash 区域让 flash 获得焦点，然后滚动页面，如果不再次点击 flash 区域，按钮的 mouseOver 事件就不响应，去掉 wmode 后就没问题了，并且用 swfobject2.2 嵌入 flash 后也没有 flash 边缘恼人的虚线了。所以如果没有必绝对不要用 wmode。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/5/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>中文输入法下 keyCode 始终等于 229</title>
		<link>http://azure.cn/archives/13</link>
		<comments>http://azure.cn/archives/13#comments</comments>
		<pubDate>Tue, 02 Jun 2009 03:36:49 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/06/02/%e4%b8%ad%e6%96%87%e8%be%93%e5%85%a5%e6%b3%95%e4%b8%8bKeyCode%e5%a7%8b%e7%bb%88%e7%ad%89%e4%ba%8e229.aspx</guid>
		<description><![CDATA[Flash（AS3）中在接收键盘响应时如果输入法是中文，所有 keyCode 都等于 229，解决办法就是将 IME.enabled 设为 false 或者 IME.conversionMode 设为 IMEConversionMode.ALPHANUMERIC_HALF
]]></description>
			<content:encoded><![CDATA[<p>Flash（AS3）中在接收键盘响应时如果输入法是中文，所有 keyCode 都等于 229，解决办法就是将 IME.enabled 设为 false 或者 IME.conversionMode 设为 IMEConversionMode.ALPHANUMERIC_HALF</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FULL_SCREEN 事件时同时“按下”空格键</title>
		<link>http://azure.cn/archives/14</link>
		<comments>http://azure.cn/archives/14#comments</comments>
		<pubDate>Sun, 31 May 2009 05:41:45 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/05/31/FULLSCREEN%e4%ba%8b%e4%bb%b6%e6%97%b6%e5%90%8c%e6%97%b6%e6%8c%89%e4%b8%8b%e7%a9%ba%e6%a0%bc%e9%94%ae.aspx</guid>
		<description><![CDATA[Flash Player 跨浏览的 BUG，AS3 触发 FULL_SCREEN 事件后同时帮我按下了空格键！网上找到一篇文章也是描述这个问题 http://blog.circlecube.com/2009/03/tutorial/as3-firefox-bug-enter-fullscreen-broadcasts-keyboard-events/
]]></description>
			<content:encoded><![CDATA[<p>Flash Player 跨浏览的 BUG，AS3 触发 FULL_SCREEN 事件后同时帮我按下了空格键！网上找到一篇文章也是描述这个问题 <a href="http://blog.circlecube.com/2009/03/tutorial/as3-firefox-bug-enter-fullscreen-broadcasts-keyboard-events/" target="_blank">http://blog.circlecube.com/2009/03/tutorial/as3-firefox-bug-enter-fullscreen-broadcasts-keyboard-events/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/14/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让人发指的 wmode=transparent</title>
		<link>http://azure.cn/archives/15</link>
		<comments>http://azure.cn/archives/15#comments</comments>
		<pubDate>Tue, 19 May 2009 05:01:08 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/05/19/%e8%ae%a9%e4%ba%ba%e5%8f%91%e6%8c%87%e7%9a%84Wmodetransparent.aspx</guid>
		<description><![CDATA[今天在 Flash 里 call js 中加入收藏的功能，js 函数包括针对 IE 的 window.external.AddFavorite() 方法，点击测试死活没反应，可是 alert() 却能蹦出来，郁闷了半小时发现去掉 wmode=transparent 就可以了，wmode 这个参数从 Macromedia 时代就是一个让人又爱又恨的功能，wmode=transparent 的陷阱至少在 IE 和 FF 中都遇到过，不小心进去半天都出不来。
]]></description>
			<content:encoded><![CDATA[<p>今天在 Flash 里 call js 中加入收藏的功能，js 函数包括针对 IE 的 window.external.AddFavorite() 方法，点击测试死活没反应，可是 alert() 却能蹦出来，郁闷了半小时发现去掉 wmode=transparent 就可以了，wmode 这个参数从 Macromedia 时代就是一个让人又爱又恨的功能，wmode=transparent 的陷阱至少在 IE 和 FF 中都遇到过，不小心进去半天都出不来。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/15/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>设置 wmode 后 Firefox 中鼠标滚轮失效</title>
		<link>http://azure.cn/archives/26</link>
		<comments>http://azure.cn/archives/26#comments</comments>
		<pubDate>Mon, 30 Mar 2009 15:28:37 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/03/30/%e8%ae%be%e7%bd%aeWmode%e5%90%8eFirefox%e4%b8%ad%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e5%a4%b1%e6%95%88.aspx</guid>
		<description><![CDATA[flash 在 Firefox 中如果 wmode 设置为 opaque 或者 transparent 后 TextField 的 SCROLL 事件不响应，其它 mouseWheel 事件也应该不能用，FP for Firefox 的 bug。
]]></description>
			<content:encoded><![CDATA[<p>flash 在 Firefox 中如果 wmode 设置为 opaque 或者 transparent 后 TextField 的 SCROLL 事件不响应，其它 mouseWheel 事件也应该不能用，FP for Firefox 的 bug。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/26/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>涂鸦 UI 组件基本完成</title>
		<link>http://azure.cn/archives/27</link>
		<comments>http://azure.cn/archives/27#comments</comments>
		<pubDate>Mon, 30 Mar 2009 10:11:10 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[树下]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/03/30/%e6%b6%82%e9%b8%a6UI%e7%bb%84%e4%bb%b6%e5%9f%ba%e6%9c%ac%e5%ae%8c%e6%88%90.aspx</guid>
		<description><![CDATA[涂鸦板中用到的 Button、ToolTip、CheckBox、Label、Slider、ScrollView、TextInput、TextArea、Alert、ColorMixer 已经完成，是在 sdevil 组件基础上改进而来的，精简优化了代码，功能和交互上有些变动，可以在时间轴中布局，虽然比 CS3 组件的用法原始很多，另外还可以在纯 AS3 项目中使用，比如 FDT 和 FlexBuilder 中用 FCSH 编译，外部创建的 skin 在编译时 Embed 到 SWF 中去。
]]></description>
			<content:encoded><![CDATA[<p>涂鸦板中用到的 Button、ToolTip、CheckBox、Label、Slider、ScrollView、TextInput、TextArea、Alert、ColorMixer 已经完成，是在 <a href="/archives/114">sdevil</a> 组件基础上改进而来的，精简优化了代码，功能和交互上有些变动，可以在时间轴中布局，虽然比 CS3 组件的用法原始很多，另外还可以在纯 AS3 项目中使用，比如 FDT 和 FlexBuilder 中用 FCSH 编译，外部创建的 skin 在编译时 Embed 到 SWF 中去。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/27/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>overState.cacheAsBitmap 的问题</title>
		<link>http://azure.cn/archives/30</link>
		<comments>http://azure.cn/archives/30#comments</comments>
		<pubDate>Sun, 22 Mar 2009 14:11:43 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2009/03/22/overStatecacheAsBitmap%e7%9a%84%e9%97%ae%e9%a2%98.aspx</guid>
		<description><![CDATA[SimpleButton 的 overState 设置了滤镜效果后鼠标移到 button 上然后改变舞台大小，鼠标再回到 button 上就不显示 overState 了，实际上只要是 overState 的 cacheAsBitmap=true 都有这个问题，可能是 FP 的 BUG，暂时不知道如何解决，先记录下来。
]]></description>
			<content:encoded><![CDATA[<p>SimpleButton 的 overState 设置了滤镜效果后鼠标移到 button 上然后改变舞台大小，鼠标再回到 button 上就不显示 overState 了，实际上只要是 overState 的 cacheAsBitmap=true 都有这个问题，可能是 FP 的 BUG，暂时不知道如何解决，先记录下来。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash CS4</title>
		<link>http://azure.cn/archives/55</link>
		<comments>http://azure.cn/archives/55#comments</comments>
		<pubDate>Thu, 25 Sep 2008 02:47:15 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://azure.cn/2008/09/25/FlashCS4.aspx</guid>
		<description><![CDATA[啥也不说，“来路不明”的图片一张。工作区域更大了，很喜欢。
]]></description>
			<content:encoded><![CDATA[<p>啥也不说，“来路不明”的<!--Ori URL: /content/binary/flcs4.jpg--><a href='http://i3.6.cn/cvbnm/26/24/ba/93876254c7e728d35312a08c047d8ceb.jpg' target='_blank' rel="lightbox[55]">图片一张</a>。工作区域更大了，很喜欢。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/55/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>不规则形状的 Bitmap Mask</title>
		<link>http://azure.cn/archives/82</link>
		<comments>http://azure.cn/archives/82#comments</comments>
		<pubDate>Sun, 16 Sep 2007 02:40:01 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[技术&开发]]></category>

		<guid isPermaLink="false">http://azure.cn/2007/09/16/%e4%b8%8d%e8%a7%84%e5%88%99%e5%bd%a2%e7%8a%b6%e7%9a%84BitmapMask.aspx</guid>
		<description><![CDATA[最近做的项目中有需要动态创建不规则图形 Mask，绘制的矢量图形 Mask 会占用大量 CPU 资源。以前以为用位图做 Mask 只能是矩形的，昨天发现把 Mask 和被 Mask 图形的 cacheAsBitmap 属性设置 true 就可以了，前提是遮罩和被遮罩的物件都是 Sprite 或者 MovieClip，不能直接用 Bitmap。下面是 AS3 的例子，AS2 同样支持。

import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;
import flash.geom.Point;
import flash.geom.Rectangle;
&#160;
var bmd:BitmapData = new BitmapData&#40;200, 200, true, 0xFFFF0000&#41;;
var bmdMask:BitmapData = new BitmapData&#40;200, 200, true&#41;;
var seed:int = int&#40;Math.random&#40;&#41; * int.MAX_VALUE&#41;;
var channels:uint = BitmapDataChannel.RED &#124; BitmapDataChannel.BLUE;
bmdMask.perlinNoise&#40;100, 80, 12, seed, false, [...]]]></description>
			<content:encoded><![CDATA[<p>最近做的项目中有需要动态创建不规则图形 Mask，绘制的矢量图形 Mask 会占用大量 CPU 资源。以前以为用位图做 Mask 只能是矩形的，昨天发现把 Mask 和被 Mask 图形的 cacheAsBitmap 属性设置 true 就可以了，前提是遮罩和被遮罩的物件都是 Sprite 或者 MovieClip，不能直接用 Bitmap。下面是 AS3 的例子，AS2 同样支持。</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:"Courier New";"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Bitmap</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">BitmapData</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">BitmapDataChannel</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span>.<span style="color: #004993;">Point</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span>.<span style="color: #004993;">Rectangle</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> bmd<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">BitmapData</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">BitmapData</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #0033ff; font-weight: bold;">true</span>, 0xFFFF0000<span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> bmdMask<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">BitmapData</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">BitmapData</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> seed<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">int</span>.<span style="color: #004993;">MAX_VALUE</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> channels<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">BitmapDataChannel</span>.<span style="color: #004993;">RED</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #004993;">BitmapDataChannel</span>.<span style="color: #004993;">BLUE</span>;
bmdMask.<span style="color: #004993;">perlinNoise</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">100</span>, <span style="color: #000000; font-weight:bold;">80</span>, <span style="color: #000000; font-weight:bold;">12</span>, seed, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #0033ff; font-weight: bold;">true</span>, channels, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> bitmap<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Bitmap</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Bitmap</span><span style="color: #000000;">&#40;</span>bmd<span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> bitmapMask<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Bitmap</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Bitmap</span><span style="color: #000000;">&#40;</span>bmdMask<span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bitmap<span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bitmapMask<span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">threshold</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span>×00800000;
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">color</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span>×00FFFFFF;
<span style="color: #6699cc; font-weight: bold;">var</span> maskColor<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span>×00FF0000;
bmdMask.<span style="color: #004993;">threshold</span><span style="color: #000000;">&#40;</span>bmdMask, bmdMask.<span style="color: #004993;">rect</span>, <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Point</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #990000;">&quot;&gt;&quot;</span>, <span style="color: #004993;">threshold</span>, <span style="color: #004993;">color</span>, maskColor, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> spriteMask = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
spriteMask.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bitmapMask<span style="color: #000000;">&#41;</span>;
spriteMask.<span style="color: #004993;">cacheAsBitmap</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>spriteMask<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> display = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
display.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bitmap<span style="color: #000000;">&#41;</span>;
display.<span style="color: #004993;">cacheAsBitmap</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>display<span style="color: #000000;">&#41;</span>;
display.<span style="color: #004993;">mask</span> = spriteMask;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/82/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server-side GIF 转 SWF</title>
		<link>http://azure.cn/archives/84</link>
		<comments>http://azure.cn/archives/84#comments</comments>
		<pubDate>Wed, 01 Aug 2007 10:14:41 +0000</pubDate>
		<dc:creator>azure</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://azure.cn/2007/08/01/ServersideGIF%e8%bd%acSWF.aspx</guid>
		<description><![CDATA[最近在做的项目需要在服务器端将 GIF 动画转换成 SWF，服务器端程序是 PHP，思路有两个：1. 使用 Swftools 的 GIF2SWF 进行转换。优点：command-line方式简单、速度快；缺点：目前版本的 GIF2SWF 对于某些类型的 GIF 动画转换不准确，有帧重叠和色彩丢失的问题，并且不能设置导出的 SWF 版本。2. 使用服务器端 GIF 动画解析器先进行分割，比如：Gifsicle（Gifsicle 网站上的命令有问题，导出单帧图片应该这样 % gifsicle anim.gif #0 &#62; firstframe.gif）、ImageMagick（MagickWand）或者 PHP GIFDecoder，然后再用 PHP Ming 生成 SWF。优点：可以提取 GIF 的单帧图片；缺点：GIF 类型很多，需要先进行类型判断，再根据不同类型进行处理，过程很麻烦，再加上 Decoder 问题多多，拆解的单帧图片会有各种问题。
两种方法都试了，最后放弃第二种，因为 Swftools 是开源的，所以决定修改 GIF2SWF 代码来解决，在 Linux 下编译 Swftools 代码很方便，只用了半天时间就解决了上面的问题，通过简单的设置后竟然可以支持导出 SWF9！这样 AS3 就可以和载入的 SWF 交互了。
]]></description>
			<content:encoded><![CDATA[<p>最近在做的项目需要在服务器端将 GIF 动画转换成 SWF，服务器端程序是 PHP，思路有两个：<br />1. 使用 <a href="http://www.swftools.org/" target="_blank">Swftools</a> 的 GIF2SWF 进行转换。优点：command-line方式简单、速度快；缺点：目前版本的 GIF2SWF 对于某些类型的 GIF 动画转换不准确，有帧重叠和色彩丢失的问题，并且不能设置导出的 SWF 版本。<br />2. 使用服务器端 GIF 动画解析器先进行分割，比如：<a href="http://www.lcdf.org/gifsicle/" target="_blank">Gifsicle</a>（Gifsicle 网站上的命令有问题，导出单帧图片应该这样 % <b>gifsicle</b> anim.gif #0 &gt; firstframe.gif）、ImageMagick（<a href="http://www.magickwand.org/" target="_blank">MagickWand</a>）或者 PHP<a href="http://www.phpclasses.org/browse/package/3163.html" target="_blank"> GIFDecoder</a>，然后再用 PHP <a href="http://www.php.net/ming" target="_blank">Ming</a> 生成 SWF。优点：可以提取 GIF 的单帧图片；缺点：GIF <a href="http://www.imagemagick.org/Usage/anim_basics/#types" target="_blank">类型很多</a>，需要先进行类型判断，再根据不同类型进行处理，过程很麻烦，再加上 Decoder 问题多多，拆解的单帧图片会有各种问题。</p>
<p>两种方法都试了，最后放弃第二种，因为 Swftools 是开源的，所以决定修改 GIF2SWF 代码来解决，在 Linux 下编译 Swftools 代码很方便，只用了半天时间就解决了上面的问题，通过简单的设置后竟然可以支持导出 SWF9！这样 AS3 就可以和载入的 SWF 交互了。</p>
]]></content:encoded>
			<wfw:commentRss>http://azure.cn/archives/84/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

