<?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>Acroidea &#187; ActionScript</title>
	<atom:link href="http://www.acroidea.com/index.php/category/flash/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acroidea.com</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 09:31:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flash中彩色图变黑白图</title>
		<link>http://www.acroidea.com/index.php/2010/07/06/flash-colorful-to-black-white/</link>
		<comments>http://www.acroidea.com/index.php/2010/07/06/flash-colorful-to-black-white/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 03:31:06 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=447</guid>
		<description><![CDATA[这两天在看ARToolKit，发现了里面有一段代码，是将彩色的图片变成黑白的。 做了一个简单的例子： [as3] package { import flash.display.*; import flash.geom.*; import flash.events.*; import flash.net.*; import flash.utils.*; import flash.filters.*; public class Test...]]></description>
			<content:encoded><![CDATA[<p>这两天在看ARToolKit，发现了里面有一段代码，是将彩色的图片变成黑白的。</p>
<p>做了一个简单的例子：</p>
<p>[as3]<br />
package<br />
{<br />
	import flash.display.*;<br />
	import flash.geom.*;<br />
	import flash.events.*;<br />
	import flash.net.*;<br />
	import flash.utils.*;<br />
	import flash.filters.*;</p>
<p>	public class Test extends Sprite<br />
	{<br />
		private static const ZERO_POINT:Point = new Point();<br />
		private static const MONO_FILTER:ColorMatrixFilter = new ColorMatrixFilter([<br />
			0.2989, 0.5866, 0.1145, 0, 0,<br />
			0.2989, 0.5866, 0.1145, 0, 0,<br />
			0.2989, 0.5866, 0.1145, 0, 0,<br />
			0, 0, 0, 1, 0<br />
		]);</p>
<p>		public function Test()<br />
		{<br />
			var char:Char = new Char();<br />
			var inbmp:BitmapData = new BitmapData(char.width, char.height, true, 0&#215;000000);<br />
			inbmp.draw(char);</p>
<p>			var outbmp:BitmapData = new BitmapData(inbmp.width, inbmp.height, false, 0&#215;0);<br />
			outbmp.applyFilter(inbmp, inbmp.rect, ZERO_POINT, MONO_FILTER);</p>
<p>			addChild(new Bitmap(outbmp));<br />
		}<br />
	}<br />
}<br />
[/as3]</p>
<p>Test.as作为一个Fla文件的文档类，Char是Fla中的一个可显示的对象。看代码的意思是对原始的彩色图片中的RGB色作一个计算：<br />
新R = 新G = 新B = 0.2989 * R + 0.5866 * G + 0.1145 * B;<br />
整不明白0.2989，0.5866，0.1145这三个常数从何而来，不过图确实变成黑白的了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2010/07/06/flash-colorful-to-black-white/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转][翻译]Flash现实增强技术入门指南</title>
		<link>http://www.acroidea.com/index.php/2010/07/02/flash-augmented-reality-flartoolkit/</link>
		<comments>http://www.acroidea.com/index.php/2010/07/02/flash-augmented-reality-flartoolkit/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 06:45:47 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[FlarToolkit]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=440</guid>
		<description><![CDATA[转自：http://www.asbinbin.com/?p=8 由于最近在研究Flash的3D及AR（Argument Reality）技术。因此这段时间集中读了一些相关方面的资料。谈不上分享经验，先翻译一篇Mikko Haapoja的文章作为开始吧。这篇博文是他在Saqoosha的《FlarToolkit入门指南》的 基础上进一步对Spark类库中的FlarToolkit（一个实现Flash AR技术的开源类库）做了比较详细的入门指导。（注：本人首次尝试翻译，欢迎大家指正。转载请注明出处） ok.开始吧————————————————— 《FlarToolkit/Flash 现实增强技术入门指南》 翻译：盐酸酸 原文地址：http://www.mikkoh.com/blog/?p=182 最近我正在尝试着研究一下FlarToolkit。什么是FlarToolkit？FlarToolkit是一 个实现Flash 现实增强技术的开源类。我在另一篇帖子里介绍了有关 它的更多细节。 我打算先讲解一下如何基于FlarToolkit开发。FlarToolkit开发时比较困难的 一点是代码内几乎所有的注释都是日文，所以如果你打算查看代码（而且你不会日语），你就不得不耗费更多的精力去研究。 开始之前，先下载这个例子（点我下载）。这个例子基于Saqoosha的简易方块的例子，但是更加简单易读。 OK，我们现在就开始学习FlarToolkit啦！ 第一步：下载...]]></description>
			<content:encoded><![CDATA[<p>转自：<a href="http://www.asbinbin.com/?p=8" target="_blank">http://www.asbinbin.com/?p=8</a></p>
<p>由于最近在研究Flash的3D及AR（Argument Reality）技术。因此这段时间集中读了一些相关方面的资料。谈不上分享经验，先翻译一篇<strong>Mikko  Haapoja</strong>的文章作为开始吧。这篇博文是他在Saqoosha的<strong>《FlarToolkit入门指南》</strong>的 基础上进一步对Spark类库中的FlarToolkit（一个实现Flash  AR技术的开源类库）做了比较详细的入门指导。（注：本人首次尝试翻译，欢迎大家指正。转载请注明出处）<br />
ok.开始吧—————————————————</p>
<p><strong>《FlarToolkit/Flash 现实增强技术入门指南》</strong><br />
翻译：<a href="http://www.asbinbin.com/" target="_blank">盐酸酸</a> 原文地址：<a href="http://www.mikkoh.com/blog/?p=182" target="_blank">http://www.mikkoh.com/blog/?p=182</a></p>
<p>最近我正在尝试着研究一下<strong>FlarToolkit</strong>。什么是FlarToolkit？FlarToolkit是一 个实现<strong>Flash 现实增强技术</strong>的开源类。我在<a href="http://www.mikkoh.com/blog/?p=129" target="_blank">另一篇帖子</a>里介绍了有关 它的更多细节。<br />
我打算先讲解一下如何基于FlarToolkit开发。FlarToolkit开发时比较困难的 一点是代码内几乎所有的注释都是日文，所以如果你打算查看代码（而且你不会日语），你就不得不耗费更多的精力去研究。<br />
开始之前，先下载这个例子（<a href="http://www.mikkoh.com/blog/wp-content/uploads/2008/12/learningflartoolkit.zip" target="_blank">点我下载</a>）。这个例子基于Saqoosha的简易方块的例子，但是更加简单易读。<br />
OK，我们现在就开始学习FlarToolkit啦！</p>
<p><strong>第一步：下载</strong><br />
在一开始，我访问了Saqoosha的博客，正打算用Google  Translater把页面翻译一下时，却发现了我最熟悉的三个字母“SVN”。HAH…有了它就好办了，我们先利用SVN工具把FlarToolkit项目全部下载吧。<br />
<strong>FlarToolkit项目的SVN url:</strong><br />
<a href="http://www.libspark.org/svn/as3/FLARToolKit/trunk" target="_blank">http://www.libspark.org/svn/as3/FLARToolKit/trunk</a><br />
（译者注：SVN工具大家应该都很熟悉了吧，如果你不知道什么是SVN，建议你先看看<a href="http://www.subversion.org.cn/" target="_blank">SVN中文站</a> 。原文作者也提供了一个<a href="http://code.google.com/p/papervision3d/wiki/Download_from_SVN" target="_blank">参考链接</a>，是PV3D的SVN下载帮助）</p>
<p><strong>第二步：查看例子和源码</strong><br />
在我想了解怎样使用某个类库之前，都会先去查看一下它提供的例子及源码。现在我来总结一下我在学习FlarToolkit过程中的一些收获。<br />
首先开始于Saqoosha的SimpleCube例子。我个人并不太喜欢他这个应用的写法（当 然从对象可复用的角度上说它是非常不错的）。<br />
在那个例子中有三个类：<strong>ARAppBase，PV3DARApp，和 SimpleCube<br />
</strong><br />
三个类分别控制着AR应用的一个部分。但是这样的代码读起来比较困难，因为<strong>PV3DARApp</strong>继承自<strong>ARAppBase</strong>， 而<strong>SimpleCube</strong>继承自<strong>PV3DARApp</strong>。为了便于阅读学习，我把上面的 三个类合并到了一起。（当然这样并不符合可复用的原则）<br />
<strong>FlarApp一共包含5个部分：</strong><br />
<strong>1.摄像头参数文件</strong><br />
<strong>2.标记文件</strong><br />
<strong>3.标记检测器</strong><br />
<strong>4.Flar Base Node</strong>（译者注：其实这个FLARBaseNode的实例就是我们装载3D物体的容器，下 面会有详细的解释）<br />
<strong>5.Papervision</strong>（译者注：这是一个flash的 3D引擎）</p>
<p><strong>摄像头参数</strong><br />
该摄像头参数文件是从外部加载的二进制文件。一开始我不知道它到底是如何而来，我到 Saqoosha的博客上去询问，他回复说这是由一个ARToolkit的一个附属程序生成的 （注：FlarToolkit是由ARToolkit演化而来，ARToolkit是现实增强技术在C++及Java等 开发语言上的实现）。这个程序名为<strong>“</strong><strong>calib_camera2”</strong>。<br />
Calib_camera2创建这个二进制的摄像头参数文件，这个文件是用来纠正从摄像头获取图像的扭曲及变形的。你可以从<a href="http://www.hitl.washington.edu/artoolkit/download/" target="_blank">这里</a>下载这个程序。但我想还是使用FlarToolkit中提供的这个原始的<strong>“camera_para.dat”</strong>文 件会更好。（我想大多数人都会这么做的）</p>
<p><strong>标记文件</strong><br />
标记文件中保存的是一个图案，Flar会在你的摄像头获取的影像中寻找这个图案。在我的制作的项目中它在这个路径下<strong>“lib/mikko.pat”</strong>。 如果你打开这个文件，你会发现有4个16 ×  48矩阵。它们分别代表着标志4个不同的方向。Flar会将你的标记图案看作一个16×16的二维码。文件中的每一个矩阵是16 ×  48，是因为要包含三种颜色（红，绿，蓝）<br />
Saqoosha已经建立了一个Air应用来制作这些标记文件。你可以下载该Air程序从<a href="http://saqoosha.net/lab/FLARToolKit/MarkerGenerator/MakerGenerator.air" target="_blank">这里</a> 。<br />
可以按照下列步骤创建一个标记文件：<br />
1.标志设计使用以下规格,你可以在方框中放置各种你想用的图形。但是我想一些棱角分明的图案会更适合些。</p>
<p>2.打印出你设计好的图案，启动刚才下载的Air程序，并将你打印好的图案放到摄像头前。当程序中有一个红色的框出现在你的图案周围后，点击<strong>“save  pattern”</strong>。生成工作就完成啦。<br />
这是整个应用中比较关键的步骤。</p>
<p><strong>标记检测器</strong><br />
标记检测器的作用就是从你摄像头中获取的bitmapdata中获取标记文件中定义的图案。一旦它找到定义的图案就会告知程序，程序就会从检测器中获得一 个变换矩阵来摆布FlarBaseNode了。</p>
<p><strong>FlarBaseNode</strong><br />
这个FlarBaseNode其实就是用来显示Papervision  3D物体的容器。利用从标记检测器中得到的变换矩阵来控制我们的3D物体的3维空间坐标。</p>
<p><strong>Papervision</strong><br />
它是Flar App的最后一块拼图了。我真的不想对它讲太多的细节了。如果你对这个3D引擎感兴趣可以直接到Google Code中找到它（<a href="http://code.google.com/p/papervision3d/" target="_blank">点这里到PV3D的 页面</a>）</p>
<p><strong>一些注意事项：</strong><br />
1.编译时遇到错误：<br />
<strong>Error: Attempted access of inaccessible property  _projectionthrough a reference with static  typeorg.libspark.flartoolkit.pv3d:FLARCamera3D.</strong></p>
<p>可以这样解决这个问题</p>
<p>到这个类中<strong>org.papervision3d.cameras.Camera3D</strong><br />
修改这个变量的命名空间<br />
<strong>private var  _projection:Matrix3D;</strong><br />
改为<br />
<strong>protected var  _projection:Matrix3D;</strong><br />
这并不会破坏PV3D的功能，只是用来让FlarToolkit中的FlarCamera3D可以调用Camera3d 类。</p>
<p>2.这个问题我也不知道为什么是这样。因为某些原因，你不得不设置Papervision的viewport为两倍。如果你不这样，你的3D物体不 会出现在你的视频显示范围内。但即使这样做了，有时候显示也并不太完美。在Saqoosha的例子中，他将viewport又平移了-4像素。我一直不喜 欢这样把摄像头中的东西都放大了两倍显示在那里。<br />
好，现在该轮到你了。有什么问题，欢迎大家交流。我不知道所有的答案，但我会尽我所能回答这些问题。<br />
–End–<br />
翻译完了，其中大部分是意译。如果有错误，欢迎大家留言指正。——盐酸酸</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2010/07/02/flash-augmented-reality-flartoolkit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash程序员常用软件及开源程序</title>
		<link>http://www.acroidea.com/index.php/2010/05/20/softs-and-open-sources-for-flash%e7%a8%8b%e5%ba%8f%e5%91%98%e5%b8%b8%e7%94%a8%e8%bd%af%e4%bb%b6%e5%8f%8a%e5%bc%80%e6%ba%90%e7%a8%8b%e5%ba%8f/</link>
		<comments>http://www.acroidea.com/index.php/2010/05/20/softs-and-open-sources-for-flash%e7%a8%8b%e5%ba%8f%e5%91%98%e5%b8%b8%e7%94%a8%e8%bd%af%e4%bb%b6%e5%8f%8a%e5%bc%80%e6%ba%90%e7%a8%8b%e5%ba%8f/#comments</comments>
		<pubDate>Thu, 20 May 2010 14:21:06 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=227</guid>
		<description><![CDATA[常用软件 1.Firefox浏览器,主要用于Flash的调试. Firefox附加插件: firebug flashtracer,调试时查看Flash调试信息. webdeveloper,最常用的就是在调试时禁用缓存. flashplayer debugger 配合flashtracer,如果不是这个版本的FlashPlayer的话,无法正常打印调试信息. 2.FlashDevelop 一个开源的Flash开发工具. 3.Adobe Flash CS3 Professional 4.Flash CS4 5.Adobe Flash Builder...]]></description>
			<content:encoded><![CDATA[<p>常用软件</p>
<p>1.Firefox浏览器,主要用于Flash的调试.<br />
Firefox附加插件:<br />
firebug<br />
flashtracer,调试时查看Flash调试信息.<br />
webdeveloper,最常用的就是在调试时禁用缓存.<br />
<a href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">flashplayer debugger</a> 配合flashtracer,如果不是这个版本的FlashPlayer的话,无法正常打印调试信息.</p>
<p>2.FlashDevelop 一个开源的Flash开发工具.</p>
<p>3.Adobe Flash CS3 Professional</p>
<p>4.Flash CS4</p>
<p>5.Adobe Flash Builder 4</p>
<p>6.Adobe Photoshop CS4</p>
<p>7.Sothink SWF Decompiler,用于反编译SWF文件.</p>
<p>8.Vizzy,调试Flash时查看调试信息,与flashtracer相同,但是不依赖具体浏览器,只要浏览器装的flashplayer是debugger版的就行.</p>
<p>9.IIS,Flash网站本地调试时使用.</p>
<p>常用开源程序</p>
<p>1.TweenLite,实现动画效果.</p>
<p>2.SwfObject,网页中嵌入SWF.</p>
<p>3.SwfAddress,实现Flash网页的Deeplink.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2010/05/20/softs-and-open-sources-for-flash%e7%a8%8b%e5%ba%8f%e5%91%98%e5%b8%b8%e7%94%a8%e8%bd%af%e4%bb%b6%e5%8f%8a%e5%bc%80%e6%ba%90%e7%a8%8b%e5%ba%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fancypantsi.com 网站上 American Design Awards</title>
		<link>http://www.acroidea.com/index.php/2009/10/31/fancypantsi-com/</link>
		<comments>http://www.acroidea.com/index.php/2009/10/31/fancypantsi-com/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 03:00:25 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[网站]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=210</guid>
		<description><![CDATA[fancypantsi.com 网站上 American Design Awards， 这已经是很久前的事了。。。，不过还是要说的，网站可以根据时间切换成白天跟黑夜，如果今天纽约天气不好下雨了，网站上也会下雨的，呵呵。 这个可是我用我自主“研发”的Flash网站框架（Willow Framework）制作的第一个网站了。之后又用此框架完成了多个Flash网站，也在这个过程中不断完善和改进了这个Flash网站框架。 基于Willow Framework的几个主要的Flash网站： http://www.fancypantsi.com（公司的美国网站） http://www.dickies.com.cn (Dickies的中国网站） http://adtchallenge.nbcsports.com http://www.lakewl.com(卧龙湖国际社区） 对于Willow Framework，下面要做的就是自动化的工作了，不过jsfl是我最讨厌的东西了，真的不想写啊。]]></description>
			<content:encoded><![CDATA[<p>fancypantsi.com 网站上 American Design Awards， 这已经是很久前的事了。。。，不过还是要说的，网站可以根据时间切换成白天跟黑夜，如果今天纽约天气不好下雨了，网站上也会下雨的，呵呵。 这个可是我用我自主“研发”的Flash网站框架（Willow Framework）制作的第一个网站了。之后又用此框架完成了多个Flash网站，也在这个过程中不断完善和改进了这个Flash网站框架。<br />
基于Willow Framework的几个主要的Flash网站：<br />
<a href="http://www.fancypantsi.com" target="_blank">http://www.fancypantsi.com</a>（公司的美国网站）<br />
<a href="http://www.dickies.com.cn" target="_blank">http://www.dickies.com.cn</a> (Dickies的中国网站）<br />
<a href="http://adtchallenge.nbcsports.com" target="_blank">http://adtchallenge.nbcsports.com</a><br />
<a href="http://www.lakewl.com" target="_blank">http://www.lakewl.com</a>(卧龙湖国际社区）</p>
<p>对于Willow Framework，下面要做的就是自动化的工作了，不过jsfl是我最讨厌的东西了，真的不想写啊。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2009/10/31/fancypantsi-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlashPlayer 9 与 10不同之处</title>
		<link>http://www.acroidea.com/index.php/2009/06/10/differ-flashplayer-9-10/</link>
		<comments>http://www.acroidea.com/index.php/2009/06/10/differ-flashplayer-9-10/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 09:51:06 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=184</guid>
		<description><![CDATA[发现了一些FlashPlayer 9 与FlashPlayer 10之间的不一样之处，很是怪异。 处理XML： 在Flash 10中将播放器设为Player 9后下面代码执行结果为 [xml] world [/xml] 而设为Player 10后执行结果为 [xml] world [/xml] //以下为代码 [as3] var xml:XML...]]></description>
			<content:encoded><![CDATA[<p>发现了一些FlashPlayer 9 与FlashPlayer 10之间的不一样之处，很是怪异。 处理XML： 在Flash 10中将播放器设为Player 9后下面代码执行结果为<br />
[xml]<br />
<site></p>
<p>world</p>
<p></site><br />
[/xml]<br />
而设为Player 10后执行结果为<br />
[xml]</p>
<p>world</p>
<p>[/xml]<br />
//以下为代码<br />
[as3]<br />
var xml:XML = <config><site></site></config>;<br />
xml = xml.site[0].appendChild(&#8220;
<p>world</p>
<p>&#8220;);<br />
trace(xml);<br />
[/as3]<br />
而下面这个代码的执行结果确又是一样的 //代码<br />
[as3]<br />
var xml:XML = <config><site></site></config>;<br />
xml = xml.site[0].appendChild(
<p>world</p>
<p>);<br />
trace(xml);<br />
[/as3]<br />
结果都是 [xml]<site>
<p>world</p>
<p> </site>[/xml] 有点晕，不知道是何原因。所以为了防止播放器的不一致，遇到这种appendChild()里面放置字符串的情况还是改用类似下面的写法，算Flash狠了。<br />
[as3]<br />
var xml:XML = <config><site></site></config>;<br />
xml = xml.site[0].appendChild(new XML(&#8220;
<p>world</p>
<p>&#8220;));<br />
trace(xml);<br />
[/as3]<br />
这样，两个播放器也就一致了。 代码的执行顺序： 这个很有问题，如果两个代码执行顺序不一致，那可能运行的效果就完全不一致。不过两个版本确实在这方面存在差异。 如果我们只是简单地新建一个Flash文件，在里面新建一个MovieClip并且在其第一帧上增加下面的代码：<br />
[as3]<br />
trace(&#8220;onframe1 before call gotoandplay 10&#8243;);<br />
gotoAndStop(10);<br />
trace(&#8220;on frame 1 after call gotoandplay 10&#8243;);<br />
[/as3]<br />
在其第10帧处插入下面的代码：<br />
[as3]<br />
trace(&#8220;now on frame 10&#8243;);<br />
[/as3]<br />
把文件的设置中的播放器设成 Flash Player 9 或者 Flash Player 10 其执行结果是一致的，都是： onframe1 before call gotoandplay 10 on frame 1 after call gotoandplay 10 now on frame 10 也就是说是执行完第一帧上的所有代码后再执行第十帧上的代码，这一点应该是跟我们想像的一致的，也没什么异议。 但是我们改一种写法，删除刚才这个文件中的这个MovieClip中的第一帧的代码，将这个MoiveClip的Class设置成TestMC，并且新建一个TestMC.as的文件，内部代码为：<br />
[as3]<br />
package<br />
{<br />
    import flash.display.MovieClip;</p>
<p>    public class TestMC extends MovieClip<br />
    {<br />
        public function TestMC()<br />
        {<br />
            stop();<br />
            trace(&#8216;[use class]before gotoAndStop 10&#8242;);<br />
            gotoAndStop(10);<br />
            trace(&#8220;[use class]after gotoAndStop 10&#8243;);<br />
        }<br />
    }<br />
}<br />
[/as3]<br />
这样一来，在播放器设成 Flash Player 9时执行的结果是： [use class]before gotoAndStop 10 [use class]after gotoAndStop 10 now on frame 10 跟刚才的上面的顺序也是一致的，不过在将播放器设成 Flash Player 10时，执行结果却是： [use class]before gotoAndStop 10 now on frame 10 [use class]after gotoAndStop 10 也就是说这样一来，先执行被调用的帧上的代码，然后再继续现有的代码，等于是把“gotoAndStop”到的相应帧上的代码插入到现有的代码中执行，这个顺序跟之前的是完全不一样的。到底是哪一种执行的顺序是更合理的？不是很好说，不过作为一个专业级的程序员，一个好的习惯是尽量少在帧上写代码。 点击此处下载与此相关的测试文件。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2009/06/10/differ-flashplayer-9-10/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>使Flex编译的swc文件在Flash下可用</title>
		<link>http://www.acroidea.com/index.php/2009/04/18/using-flex-swc-files-in-the-flash-cs3-authoring-environment/</link>
		<comments>http://www.acroidea.com/index.php/2009/04/18/using-flex-swc-files-in-the-flash-cs3-authoring-environment/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 04:51:22 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=172</guid>
		<description><![CDATA[一直不明白如何将很多的类编译成一个swc文件，并且在Flash里可用，就像Google Map Flash API一样，今天终于找到了。http://vincent.the.tsao.googlepages.com/ 这篇文章有很详细的说明。现转于此： Using Flex SWC Files in the Flash CS3 Authoring Environment by Vincent Tsao Last updated:...]]></description>
			<content:encoded><![CDATA[<p>一直不明白如何将很多的类编译成一个swc文件，并且在Flash里可用，就像Google Map Flash API一样，今天终于找到了。<strong>http://vincent.the.tsao.googlepages.com/</strong> 这篇文章有很详细的说明。现转于此：</p>
<div id="header">
<div class="wrapper">
<h3 id="page-title">
<div id="g_title">Using Flex SWC Files in the Flash CS3 Authoring  Environment</div>
</h3>
<p class="description">
<div id="g_description">
<p>by Vincent Tsao</p></div>
</div>
</div>
<p><!-- /editable --><!-- /wrapper --><!-- /header --></p>
<div id="main-content">
<div class="wrapper">
<div class="content-item">
<div id="g_body"><strong>Last updated:</strong> 24-August-2008</p>
<p><strong>Problem</strong></p>
<p>Many API’s or code libraries written  in ActionScript 3 and compiled into SWC files are meant for use with Flex tools  and are unable to be imported into the Flash CS3 Authoring Environment.  This  tutorial will show you how you can (theoretically) take any SWC made for Flex  and use it in Flash CS3.</p>
<p><strong>Resources</strong></p>
<p>You will need the  following programs/tools:</p>
<ul>
<li>Flash CS3</li>
<li>Flex SDK 2.0.1 with Hotfix 3</li>
</ul>
<p>(note that we are intentionally NOT  using Flex SDK 3.0)</p>
<p>You can get Flex SDK 2.0.1 with Hotfix 3 here:<br />
<a href="http://labs.adobe.com/technologies/flex/sdk/flex2sdk.html" target="_blank">http://labs.adobe.com/technologies/flex/sdk/flex2sdk.html</a></p>
<p><strong>Explanation</strong></p>
<p>If  you just want the steps, you can skip down to the next section, but this  describes why the method works.  When we say “Flex SWC”, what we really mean is  a code-only SWC file which contains no DisplayObject components.  Only SWC files  with a DisplayObject component can be imported into the Flash CS3 Authoring  Environment.  Thus in order to make a Flex SWC usable in Flash CS3, we use the  Flex SDK’s <strong>compc</strong> tool to statically link it with a stub SWC file  generated in Flash CS3 that is a DisplayObject.  We require the Flex SDK 2.0.1  Hotfix 3 version of <strong>compc</strong> because Flex SDK 3.0’s <strong>compc</strong> utility  generates SWC files of version 1.2 and Flash CS3 can only use SWC files of  version 1.0.  More over, earlier versions of the Flex SDK 2.0.1 <strong>compc</strong> utility could not read SWC files compiled by the Flash CS3 authoring  environment, thus the need for Hotfix 3.  So the newly compiled SWC file is  actually two SWC files put into one – a DisplayObject SWC and the original Flex  SWC and can therefore be used within Flash  CS3.</p>
<p><strong>Steps</strong></p>
<p><span style="text-decoration: underline;">Part I: Creating a Stub DisplayObject SWC in  Flash CS3</span></p>
<ol>
<li>Create a new ActionScript 3 FLA file in Flash CS3.</li>
<li>Create a new symbol in the library (you do not need to create an instance of  it), name it whatever you want.</li>
<li>Go into your library and right click on the symbol you just created.  Select  “Component Definition…”</li>
<li>Type in whatever you want your component to be called as the class name (no  spaces).</li>
<li>Under the options part, check all the boxes and ensure the minimum Flash  Player is 9 and the minimum ActionScript version is 3.</li>
<li>Leave everything else alone, press OK.</li>
<li>Right click the symbol again in your library and select and select  “Linkage…”</li>
<li>Check the “Export for ActionScript” box and the “Export in first frame” box  should be automatically checked as well.</li>
<li>The class name should be the same name you gave it earlier.</li>
<li>Ensure the base class is indeed MovieClip, click OK.</li>
<li>Right click the symbol again in your library and select “Export SWC File…”</li>
<li>Pick a place to save it.</li>
</ol>
<p><span style="text-decoration: underline;">Part II: Putting the two SWC Files  Together</span></p>
<ol>
<li>Use the compc program to wrap what you have just created with the Flex SWC  you want to use in the Flash CS3 authoring environment.  Here is a simple  example:<code>compc -source-path+=. -output=bin\map_flash_1_6.swc&nbsp;&nbsp;-include-libraries=.\GoogleMapsFlashAPI.swc,.\map_flex_1_6.swc</code>Note  the above command is all on one line (no line breaks). The file  “map_flash_1_6.swc” is the name we choose for the component we output.  “GoogleMapsFlashAPI.swc” is the name of the SWC we created in Flash CS3 in Step  1 and “map_flex_1_6.swc” is the SWC you want to be able to use in Flash  CS3.</li>
<li>Place your newly generated SWC file in your Flash components folder. It  should be something like “\Adobe Flash CS3\en\Configuration\Components\”. If you  are unsure where this is located on your computer, Google it.</li>
<li>Open the FLA file you want to import the SWC into and open the Components  panel (Ctrl+F7 in Windows).</li>
<li>Reload the Components panel if necessary.</li>
<li>Drag your SWC file into your library (note: that there does NOT need to be  an instance of the SWC on your stage since it would be useless).</li>
</ol>
<p>Please let me know if this does not work.<br />
My contact is  vincent.the.tsao [--at--] gmail [--dot--] com</p></div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2009/04/18/using-flex-swc-files-in-the-flash-cs3-authoring-environment/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flash中显示HTML页面</title>
		<link>http://www.acroidea.com/index.php/2008/08/07/show-html-page-in-flash/</link>
		<comments>http://www.acroidea.com/index.php/2008/08/07/show-html-page-in-flash/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:05:09 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=79</guid>
		<description><![CDATA[　　每次遇到要在Flash中显示HTML内容，都是噩梦，Flash里的TextField是可以显示HTML内容的，但是，功能确实很差劲，尤其是再遇上对排版要求比较高的时候，TextField是根本做不了的了。有一个开源项目htmlwrapper倒是可以利用一下，htmlwrapper可以让当前的HTML的页面以Flash的形式显示。http://motionandcolor.com/wrapper/这个是它的一个示例，它将一个WordPress的页面用Flash的方式显示出来，你要是查看它的源代码就会发现，所有的内容其实都是写在页面里，而不是Flash里的。但是，我个人觉得把一个本来在浏览器里正常显示的HTML页面放到Flash里显示没什么好处。 　　不过嘛，如果用这个项目来把我们要显示的某个HTML加载到我们的Flash里，倒是也不错。只是CSS样式只有部分支持，而且这个项目还有不少的Bug。但是在没有其他解决方法的情况下也只能用这个，总比使用TextField强。]]></description>
			<content:encoded><![CDATA[<p>　　每次遇到要在Flash中显示HTML内容，都是噩梦，Flash里的TextField是可以显示HTML内容的，但是，功能确实很差劲，尤其是再遇上对排版要求比较高的时候，TextField是根本做不了的了。有一个开源项目<a href="http://code.google.com/p/htmlwrapper/" target="_blank">htmlwrapper</a>倒是可以利用一下，htmlwrapper可以让当前的HTML的页面以Flash的形式显示。<a href="http://motionandcolor.com/wrapper/" target="_blank">http://motionandcolor.com/wrapper/</a>这个是它的一个示例，它将一个WordPress的页面用Flash的方式显示出来，你要是查看它的源代码就会发现，所有的内容其实都是写在页面里，而不是Flash里的。但是，我个人觉得把一个本来在浏览器里正常显示的HTML页面放到Flash里显示没什么好处。<br />
　　不过嘛，如果用这个项目来把我们要显示的某个HTML加载到我们的Flash里，倒是也不错。只是CSS样式只有部分支持，而且这个项目还有不少的Bug。但是在没有其他解决方法的情况下也只能用这个，总比使用TextField强。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2008/08/07/show-html-page-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash远程调试</title>
		<link>http://www.acroidea.com/index.php/2008/08/05/remote-debug-flash/</link>
		<comments>http://www.acroidea.com/index.php/2008/08/05/remote-debug-flash/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 11:49:43 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=75</guid>
		<description><![CDATA[　　Flash里调试工具是可以实现远程调试的，这个有时也很有用，比如在某些时候，在Flash调用了外部的文件（XML等等），当你在本地DEBUG时，可能就会出现安全沙箱冲突的问题，这个时候，远程调试就派上用场了。 要使用远程调试，首先就是要下一个Debug版的Flash浏览器插件。具体下载网址是：http://www.adobe.com/support/flashplayer/downloads.html 。下载安装好后，下面就是要把你的要调试的Flash发一个Debug版本（SHIFT+CTRL+ENTER），接着使得Flash能够通过http://localhost/XX/XX.swf这样的路径访问，也就是配IIS或者Apache了，然后点击Flash编辑器里的调试-&#62;开始远程调试会话-&#62;ActionScript 3，最后通过在浏览器里输入http://localhost/XX/XX.swf这样的网址访问你的SWF,这时你发现Flash编辑器里的调试工具就会有响应了。]]></description>
			<content:encoded><![CDATA[<p>　　Flash里调试工具是可以实现远程调试的，这个有时也很有用，比如在某些时候，在Flash调用了外部的文件（XML等等），当你在本地DEBUG时，可能就会出现安全沙箱冲突的问题，这个时候，远程调试就派上用场了。<br />
要使用远程调试，首先就是要下一个Debug版的Flash浏览器插件。具体下载网址是：<a href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">http://www.adobe.com/support/flashplayer/downloads.html<br />
</a>。下载安装好后，下面就是要把你的要调试的Flash发一个Debug版本（SHIFT+CTRL+ENTER），接着使得Flash能够通过http://localhost/XX/XX.swf这样的路径访问，也就是配IIS或者Apache了，然后点击Flash编辑器里的调试-&gt;开始远程调试会话-&gt;ActionScript 3，最后通过在浏览器里输入http://localhost/XX/XX.swf这样的网址访问你的SWF,这时你发现Flash编辑器里的调试工具就会有响应了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2008/08/05/remote-debug-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>实现AS3（Flash9）与AS2（Flash8）的相互通信</title>
		<link>http://www.acroidea.com/index.php/2008/08/05/as3-as2-communicate/</link>
		<comments>http://www.acroidea.com/index.php/2008/08/05/as3-as2-communicate/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 11:22:37 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=72</guid>
		<description><![CDATA[　　AS3与AS2使用了不同的ActionScript 虚拟机（ActionScript Virtual Machine （AVM）），两者相互通信还是比较困难的，要是你在一个现有的Flash 9版本的一个SWF里加载一个Flash 8版本的SWF是可以的，但是，你直接调用里面的方法是不被允许的，要是你trace一下加载进来的内容，你会发现它的类型是AVM1Movie，这个类型的文档里有详细解释： 　　AVM1Movie 是表示使用 ActionScript 1.0 或 2.0 的 AVM1 影片剪辑的简单类。 （AVM1 是用于运行 ActionScript 1.0...]]></description>
			<content:encoded><![CDATA[<p>　　AS3与AS2使用了不同的ActionScript 虚拟机（ActionScript Virtual Machine （AVM）），两者相互通信还是比较困难的，要是你在一个现有的Flash 9版本的一个SWF里加载一个Flash 8版本的SWF是可以的，但是，你直接调用里面的方法是不被允许的，要是你trace一下加载进来的内容，你会发现它的类型是AVM1Movie，这个类型的文档里有详细解释：</p>
<p>　　AVM1Movie 是表示使用 ActionScript 1.0 或 2.0 的 AVM1 影片剪辑的简单类。 （AVM1 是用于运行 ActionScript  1.0 和 2.0 的 ActionScript 虚拟机。AVM2 是用于运行 ActionScript 3.0 的 ActionScript 虚拟机。） 当  Loader 对象加载 Flash Player 8 或更低版本的 SWF 文件时，会创建 AVM1Movie 对象。 AVM1Movie 对象可以使用继承自  DisplayObject 类的方法和属性（如 <code>x</code>、<code>y</code>、<code>width</code> 等）。  但是，不允许 AVM1Movie 对象和 AVM2 对象之间进行互操作（如调用方法或使用参数）。</p>
<p>　　AVM2 SWF 文件加载 AVM1 SWF 文件具有几个限制：</p>
<ul>
<li>加载的 AVM1Movie 对象将作为 AVM1 SWF 文件和它加载的所有 AVM1 SWF 文件的 psuedo-root 对象操作（如同将  ActionScript 1.0 <code>lockroot</code> 属性设置为 <code>true</code>）。 AVM1  影片始终位于任何子级中任何 ActionScript 1.0 或 2.0 代码执行的顶部。 除非在加载的 AVM1 SWF 文件中设置  <code>lockroot</code> 属性，否则加载的子级的 <code>_root</code> 属性通常均为该 AVM1 SWF 文件。</li>
<li>AVM1 内容无法将文件加载到各级别。 例如，它无法通过调用 <code>loadMovieNum(&quot;url&quot;, levelNum)</code> 来加载文件。</li>
<li>由 AVM2 SWF 文件加载的 AVM1 SWF 文件无法将其它 SWF 文件加载到 <code>this</code>。  也就是说，它无法向其自身加载其它 SWF 文件。 但是，由该 SWF 文件加载的子 Sprite 对象、MovieClip 对象或其它 AVM1 SWF  文件可以加载到 <code>this</code>。</li>
</ul>
<p>　　不过最近在网上还是发现了两个东东可以实现两者的相互通信和方法调用，一个是<br />
<a href="http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html" target="_blank">SWFBridge: Easier AS3 to AS2 Communication</a>，另一个是<a href="http://www.flashextensions.com/products/flashinterface.php" target="_blank">FlashInterFace</a>。两个网站上都有不错的事例，要是确实有这个需求的倒是可以看一下，不过Flash 8毕竟要成历史了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2008/08/05/as3-as2-communicate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>两篇关于AS3 Loader内存泄漏的文章</title>
		<link>http://www.acroidea.com/index.php/2008/08/02/as3-loader-memory-leak/</link>
		<comments>http://www.acroidea.com/index.php/2008/08/02/as3-loader-memory-leak/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 08:18:10 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.acroidea.com/?p=68</guid>
		<description><![CDATA[两篇关于AS3 Loader内存泄漏的文章： http://www.dreaminginflash.com/2007/10/22/memory-leak-in-as3-loader-class/ http://www.gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html]]></description>
			<content:encoded><![CDATA[<p>两篇关于AS3 Loader内存泄漏的文章：</p>
<p><a href="http://www.dreaminginflash.com/2007/10/22/memory-leak-in-as3-loader-class/" target="_blank">http://www.dreaminginflash.com/2007/10/22/memory-leak-in-as3-loader-class/</a></p>
<p><a href="http://www.gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html" target="_blank">http://www.gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.acroidea.com/index.php/2008/08/02/as3-loader-memory-leak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
