<?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://www.ooso.net/category/flash/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ooso.net</link>
	<description>Linux + Apache + Mysql + Php + Flash</description>
	<lastBuildDate>Mon, 15 Mar 2010 15:59:24 +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>用firebug来调试actionscript</title>
		<link>http://www.ooso.net/archives/442</link>
		<comments>http://www.ooso.net/archives/442#comments</comments>
		<pubDate>Thu, 03 Jul 2008 13:23:17 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[firebug]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/442</guid>
		<description><![CDATA[往常调试actionscript，是用的trace，在flash debug player里头输出变量内容。今天看到的方法比较有趣，是利用javascript在firebug中输出as的调试信息。
用firebug调试as的基本原理
PLAIN TEXT
CODE:

				<span class="readmore"><a href="http://www.ooso.net/archives/442" title="用firebug来调试actionscript">阅读全文（320字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>往常调试actionscript，是用的trace，在flash debug player里头输出变量内容。今天看到的方法比较有趣，是利用javascript在<a href="http://www.ooso.net/index.php/archives/294">firebug</a>中输出as的调试信息。</p>
<h3>用firebug调试as的基本原理</h3>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showCodeTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<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;">ExternalInterface.<span style="">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'console.log'</span>, <span style="color:#CC0000;">"string is [%s]"</span>,&nbsp; <span style="color:#CC0000;">"abcde"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
利用as的ExternalInterface和js交互，然后调用firebug的console.log，将as的变量输出到控制台，这样也能达到调试的目的。</p>
<p>当然，要使用firebug，前提当然是你使用的firefox浏览器。如果是ie，那么只好使用alert弹出信息。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/442/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>用来调试flash的air应用</title>
		<link>http://www.ooso.net/archives/416</link>
		<comments>http://www.ooso.net/archives/416#comments</comments>
		<pubDate>Sun, 08 Jun 2008 22:44:31 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[air]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/416</guid>
		<description><![CDATA[看到一个名为Arthropod的air应用，可以用来记录flash的log信息，并以颜色区分。如果你采用Flash CS3创建了一个air应用，那么它的trace命令不会生效，这样对调试是很不方便的。
这个时候Arthropod就显得很有用。
用法


				<span class="readmore"><a href="http://www.ooso.net/archives/416" title="用来调试flash的air应用">阅读全文（257字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>看到一个名为<a href="http://arthropod.stopp.se/">Arthropod</a>的<a href="/?tag=air">air</a>应用，可以用来记录flash的log信息，并以颜色区分。如果你采用Flash CS3创建了一个air应用，那么它的trace命令不会生效，这样对调试是很不方便的。</p>
<p>这个时候Arthropod就显得很有用。</p>
<h3>用法</h3>
<ul>
<li>在actionscript中导入Debug类:
<div class="igBar"><span id="lcode-5"><a href="#" onclick="javascript:showCodeTxt('code-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-5">
<div class="code">
<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;">import com.<span style="">carlcalderon</span>.<span style="">arthropod</span>.<span style="">Debug</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></li>
<li>输出debug信息
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showCodeTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<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;">Debug.<span style="">log</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"My log message"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></li>
<li>然后启动arthropod</li>
</ul>
<p><img src="http://theflashblog.com/images/arthropod.jpg" alt="arthropod" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/416/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>我也试用YUI Uploader</title>
		<link>http://www.ooso.net/archives/405</link>
		<comments>http://www.ooso.net/archives/405#comments</comments>
		<pubDate>Fri, 30 May 2008 01:58:11 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yui]]></category>
		<category><![CDATA[上传]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/405</guid>
		<description><![CDATA[早就知道YUI里面有Uploader这么一个上传组件，可以按住ctrl多选文件上传(就像flickr那样的上传)，并且可以支持进度条，这样对用户来说是相当方便的。
由于YUI Uploader是利用javascript + flash实现的，所以用户的浏览器上只要有flash player就可以使用，也不需要额外安装别的插件了，这显然也是YUI Uploader的一大优势。
我的YUI Uploader试用之旅


				<span class="readmore"><a href="http://www.ooso.net/archives/405" title="我也试用YUI Uploader">阅读全文（1139字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>早就知道<a href="http://developer.yahoo.com/yui/">YUI</a>里面有Uploader这么一个上传组件，可以按住ctrl多选文件上传(就像flickr那样的上传)，并且可以支持进度条，这样对用户来说是相当方便的。</p>
<p>由于YUI Uploader是利用javascript + <a href="/?tag=flash">flash</a>实现的，所以用户的浏览器上只要有flash player就可以使用，也不需要额外安装别的插件了，这显然也是YUI Uploader的一大优势。</p>
<h3>我的YUI Uploader试用之旅</h3>
<ul>
<li>首先<a href="http://developer.yahoo.com/yui/examples/uploader/assets/uploader-advanced.zip">下载Uploader批量上传页的html源文件</a></li>
<li>解压后放置在你的web服务器上，比如我就是在自己的台式机上安装了一个xampp</li>
<li>现在需要一个处理上传操作的后端程序，在这里我是用php简单的写了一个，如果你用别的语言也是不成问题的。在<b>uploader-advanced-source.html</b>的同一目录下放置<b>upload.php</b>，源文件如下：
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showCodeTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<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:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_FILES</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$fieldName</span> =&gt; <span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$name</span> = <span style="color:#000066;">md5</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000066;">microtime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#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; &nbsp; <span style="color:#000066;">move_uploaded_file</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'tmp_name'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#FF0000;">"./"</span> . <span style="color:#0000FF;">$name</span> . <span style="color:#FF0000;">'.jpg'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000066;">echo</span> <span style="color:#0000FF;">$fieldName</span> . <span style="color:#FF0000;">' uploaded!'</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></li>
<li>下载http://yui.yahooapis.com/2.5.1/build/uploader/assets/uploader.swf，然后把<b>uploader.swf</b>放在和<b>upload.php</b>的同一目录下，这是为了避免javascript和flash交互过程中出现跨域问题。</li>
<li>修改uploader-advanced-source.html
<ul>
<li>把"YOUR UPLOAD URL GOES HERE"替换成你的upload.php所在的url，比如我的就是http://localhost/yui/upload.php
<li>把YAHOO.widget.Uploader.SWFURL修改成你的uploader.swf实际url</li>
</ul>
</li>
<li>现在访问uploader-advanced-source.html，试试批量上传功能吧</li>
</ul>
<h3>试用的一点补充</h3>
<ul>
<li>这个例子里面的php源文件只是考虑上传n张jpg文件的情况，可根据实际情况调整。</li>
<li>上传后的文件名是md5随机加密的，在upload.php同一目录可见</li>
<li>由于flash的bug，运行在windows下的firefox无法正确获得flash传递过来的cookie，如果上传应用对cookie有依赖，可能会需要做额外的处理。</li>
<li><del>为了能够确切的显示上传进度条，可能需要php 5.2的<a href="http://pecl.php.net/package/APC">apc</a>扩展支持</del></li>
<li>上传进度由flash完成</li>
<li>YUI 2.5.2已经附上uploader.swf的actionscript，有一定的学习价值</li>
</ul>
<h3>贴一张Uploader使用效果图</h3>
<p><img src="http://developer.yahoo.com/yui/examples/uploader/assets/uploader-advanced.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/405/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>用AIR生成土豆豆单批量下载清单</title>
		<link>http://www.ooso.net/archives/402</link>
		<comments>http://www.ooso.net/archives/402#comments</comments>
		<pubDate>Sun, 25 May 2008 23:30:33 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[土豆]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=402</guid>
		<description><![CDATA[把之前的greasemonkey脚本又加工了一下，这次改用air做了一个桌面小工具，功能完全一样，可以生成土豆的豆单批量下载清单，有所改进的是，能够生成中文的下载文件，这样下载回来就可以连续观看而不用费事去查了。
使用方法

首先下载安装air runtime

				<span class="readmore"><a href="http://www.ooso.net/archives/402" title="用AIR生成土豆豆单批量下载清单">阅读全文（434字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>把之前的greasemonkey脚本又加工了一下，这次改用<a href="/?tag=air">air</a>做了一个桌面小工具，功能完全一样，可以生成土豆的豆单批量下载清单，有所改进的是，能够生成中文的下载文件，这样下载回来就可以连续观看而不用费事去查了。</p>
<h3>使用方法</h3>
<ul>
<li>首先下载安装<a href="http://get.adobe.com/air/" target="_blank">air runtime</a></li>
<li>下载<a href="http://customcode.googlecode.com/files/flvMaster.air">flvMaster.air</a>，文件很小，只有29k</li>
<li>双击flvMaster.air即可呼出air的安装界面，进一步安装</li>
<li>界面非常简单，在url输入框里输入豆单的播放url，然后点击search按钮，这样就会在下面的输入框中生成豆单的下载清单</li>
<li>接下来点击save按钮就可以保存下载清单到桌面了，保存的文件名最好以lst做后缀</li>
<li>可以用flashget来导入下载清单并批量下载flv视频</li>
</ul>
<p>用air来写这种小工具真的是非常方便，一点点html+javascript代码就可以完成很实用的功能，尤其是ajax操作，完全没有跨域限制，很强大。</p>
<h3>贴一张运行时的界面图</h3>
<p><a href='http://www.ooso.net/wp-content/uploads/2008/05/flvmaster.gif'><img src="http://www.ooso.net/wp-content/uploads/2008/05/flvmaster-300x233.gif" alt="" title="flvmaster" width="300" height="233" class="alignnone size-medium wp-image-403" /></a></p>
<h3>补充</h3>
<p>Air现在发布了1.1中文版，国内用户也可以享受到中文界面的Air了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/402/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CachegrindVisualizer</title>
		<link>http://www.ooso.net/archives/338</link>
		<comments>http://www.ooso.net/archives/338#comments</comments>
		<pubDate>Mon, 28 Jan 2008 04:35:50 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/338</guid>
		<description><![CDATA[CachegrindVisualizer是一个xdebug的profile文件查看客户端,采用Adobe的AIR制作,很让人惊讶,因为目前我看到的采用AIR制作的软件少的可怜.
与CachegrindVisualizer具有类似功能的软件还有wincachegrind,相比之下,wincachegrind的功能更为强大,使用上也更方便.但是即便如此,我还是乐见CachegrindVisualizer发展的更好.
CachegrindVisualizer支持的操作系统
Windows 2000 SP4, Windows XP SP2, Windows Vista Home and Ultimate Edition, Mac OS 10.4.7 and above (Intel and PowerPC), Mac OS X Leopard.

				<span class="readmore"><a href="http://www.ooso.net/archives/338" title="CachegrindVisualizer">阅读全文（375字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/cachegrindvisualizer/">CachegrindVisualizer</a>是一个<a href="/index.php?tag=xdebug">xdebug</a>的profile文件查看客户端,采用Adobe的<a href="/index.php?tag=air">AIR</a>制作,很让人惊讶,因为目前我看到的采用AIR制作的软件少的可怜.</p>
<p>与CachegrindVisualizer具有类似功能的软件还有wincachegrind,相比之下,wincachegrind的功能更为强大,使用上也更方便.但是即便如此,我还是乐见CachegrindVisualizer发展的更好.</p>
<h2>CachegrindVisualizer支持的操作系统</h2>
<p>Windows 2000 SP4, Windows XP SP2, Windows Vista Home and Ultimate Edition, Mac OS 10.4.7 and above (Intel and PowerPC), Mac OS X Leopard.</p>
<h2>运行时的抓图</h2>
<p><img src="http://cachegrindvisualizer.googlecode.com/files/p_CachegrindVisualizer-0.5.2-screenshot.png" alt="CachegrindVisualizer" /></p>
<h2>相关连接</h2>
<ul>
<li><a href="http://labs.adobe.com/downloads/air.html">AIR RUNTIME下载</a></li>
<li><a href="http://xdebug.org">xdebug</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/338/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ajax Vs Flash</title>
		<link>http://www.ooso.net/archives/353</link>
		<comments>http://www.ooso.net/archives/353#comments</comments>
		<pubDate>Fri, 20 Jul 2007 00:11:01 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/353</guid>
		<description><![CDATA[在RIA应用中,到底应该使用Ajax,还是使用Flash呢?它们各有长处,让人难以取舍.下面就它们的特点做一个小小的总结.

Javascript
+ 不需要额外的插件.

				<span class="readmore"><a href="http://www.ooso.net/archives/353" title="Ajax Vs Flash">阅读全文（282字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>在RIA应用中,到底应该使用<a href="index.php?tag=ajax">Ajax</a>,还是使用Flash呢?它们各有长处,让人难以取舍.下面就它们的特点做一个小小的总结.</p>
<ul>
<h1>Javascript</h1>
<li>+ 不需要额外的插件.</li>
<li>- 不同的浏览器下可能会产生不同的行为</li>
<li>- 不能访问音视频设备</li>
<li>- 可能会有少数用户会关闭javascript</li>
<li>- 如果你写的代码很烂,大家都能看到</li>
</ul>
<ul>
<h1>Flash</h1>
<li>- 需要额外安装插件</li>
<li>+ 在各种浏览器上,如果flash player的版本一致,那么flash的行为也会基本一致</li>
<li>- 用户可能不会安装有相同版本的flash player</li>
<li>+ 可以直接访问音视频设备</li>
<li>- 可能会有很多用户屏蔽flash</li>
<li>+ 如果你写的代码很烂,不用担心,大家都看不到</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/353/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>关于Flash LoadVars的常识</title>
		<link>http://www.ooso.net/archives/343</link>
		<comments>http://www.ooso.net/archives/343#comments</comments>
		<pubDate>Fri, 29 Jun 2007 00:48:30 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[cookie]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/343</guid>
		<description><![CDATA[Flash player通过loadVars的各种方法发出去的请求，能够继承浏览器的cookie，它并不独立。因此，某些需要cookie认证才能访问的接口url，也是能够直接用Flash发出请求直接调用的——这阵子费了好大功夫才明白这个常识性问题。
]]></description>
			<content:encoded><![CDATA[<p>Flash player通过loadVars的各种方法发出去的请求，能够继承浏览器的cookie，它并不独立。因此，某些需要cookie认证才能访问的接口url，也是能够直接用<a href="index.php?tag=flash">Flash</a>发出请求直接调用的——这阵子费了好大功夫才明白这个常识性问题。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/343/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>flash和javascript之间的交互 —— ExternalInterface</title>
		<link>http://www.ooso.net/archives/222</link>
		<comments>http://www.ooso.net/archives/222#comments</comments>
		<pubDate>Sun, 20 Aug 2006 23:52:00 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/222</guid>
		<description><![CDATA[版权声明：可以任意转载，转载时请务必以超链接形式标明文章原始出处和作者信息及本声明
最近做一个应用，flash和javascript之间互有调用。最后一次写点Actionscript也是在flash 7的时候了，因此按照我的想法，只要用fscommand和getUrl("javasciprt:.......")这种形式，flash和javascript之间互相调用应该不是什么大问题。
没多久就开始觉着自己落后了，Flash 8早已经新增了ExternalInterface API专门处理flash与外部应用的交互，只要浏览器装有flash player，支持的范围应是更广。

				<span class="readmore"><a href="http://www.ooso.net/archives/222" title="flash和javascript之间的交互 —— ExternalInterface">阅读全文（1421字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><strong>版权声明：可以任意转载，转载时请务必以超链接形式标明文章原始出处和作者信息及本声明</strong></p>
<p>最近做一个应用，flash和javascript之间互有调用。最后一次写点Actionscript也是在flash 7的时候了，因此按照我的想法，只要用fscommand和getUrl("javasciprt:.......")这种形式，flash和javascript之间互相调用应该不是什么大问题。</p>
<p>没多久就开始觉着自己落后了，<a href="http://www.ooso.net/index.php/archives/category/flash/">Flash</a> 8早已经新增了ExternalInterface API专门处理flash与外部应用的交互，只要浏览器装有flash player，支持的范围应是更广。</p>
<h3>ExternalInterface class能够运行的环境</h3>
<ul>
<li>Internet Explorer for Windows (5.0 and later)</li>
<li>Firefox 1.0 and later</li>
<li>Mozilla 1.7.5 and later</li>
<li>Netscape 8.0 and later</li>
<li>Safari 1.3 and later. </li>
</ul>
<h3>使用心得</h3>
<p>ExternalInterface class仅仅只有两个方法：</p>
<p><span id="more-222"></span></p>
<ul>
<li>addCallback(methodName:String, instance:Object, method:Function) : Boolean<br />
 Registers an ActionScript method as callable from the container.</li>
<li>call(methodName:String, [parameter1:Object]) : Object<br />
 Calls a function exposed by the Flash Player container, passing 0 or more arguments.</li>
</ul>
<p>这两个方法的使用在手册有详细说明，使用范例可以从flash的安装路径例如C:\Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript\ExternalAPI下面找到，没太大悬念。</p>
<h3>碰到的问题</h3>
<p>在IE浏览器下，将flash对象放在form标签之间，ExternalInterface class就会给你报javascript错，而<a href="http://www.ooso.net/index.php/archives/category/firefox/">firefox</a>下完全正常，这简直是让人很郁闷的事情，折腾了一天才找到问题原因，可能是IE的Bug吧，这个在livedoc上有人反映过类似的问题。见下面的url:<br />
<a href="http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00002200.html">http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00002200.html</a></p>
<p>有人提出这样的解决办法，将下面这段<a href="http://www.ooso.net/index.php/archives/category/javascript/">javascript</a>放在html里的flash之前：</p>
<div class="igBar"><span id="lcode-11"><a href="#" onclick="javascript:showCodeTxt('code-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-11">
<div class="code">
<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;">&lt;script type=<span style="color:#CC0000;">"text/javascript"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function ExternalInterfaceManager<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#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:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; this.<span style="">registerMovie</span> = function<span style="color:#006600; font-weight:bold;">&#40;</span>movieName<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>!window.<span style="">fakeMovies</span><span style="color:#006600; font-weight:bold;">&#41;</span> window.<span style="">fakeMovies</span> = new Array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; window.<span style="">fakeMovies</span><span style="color:#006600; font-weight:bold;">&#91;</span>window.<span style="">fakeMovies</span>.<span style="">length</span><span style="color:#006600; font-weight:bold;">&#93;</span> = movieName;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; this.<span style="">initialize</span> = function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>document.<span style="">all</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>window.<span style="">fakeMovies</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>i=<span style="color:#800000;color:#800000;">0</span>;i&lt;window.<span style="">fakeMovies</span>.<span style="">length</span>;i++<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window<span style="color:#006600; font-weight:bold;">&#91;</span>window.<span style="">fakeMovies</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = new Object<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.<span style="">onload</span> = initializeExternalInterface;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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:#006600; font-weight:bold;">&#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;">function initializeExternalInterface<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>i=<span style="color:#800000;color:#800000;">0</span>;i&lt;window.<span style="">fakeMovies</span>.<span style="">length</span>;i++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; var movieName = window.<span style="">fakeMovies</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var fakeMovie = window<span style="color:#006600; font-weight:bold;">&#91;</span>movieName<span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; var realMovie = document.<span style="">getElementById</span><span style="color:#006600; font-weight:bold;">&#40;</span>movieName<span style="color:#006600; font-weight:bold;">&#41;</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;">&nbsp; &nbsp; &nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>var method in fakeMovie<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert<span style="color:#006600; font-weight:bold;">&#40;</span>arguments<span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; realMovie<span style="color:#006600; font-weight:bold;">&#91;</span>method<span style="color:#006600; font-weight:bold;">&#93;</span> = function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>flashFunction = <span style="color:#CC0000;">"&lt;invoke name=<span style="color:#000099; font-weight:bold;">\"</span>"</span> + method.<span style="">toString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\"</span> returntype=<span style="color:#000099; font-weight:bold;">\"</span>javascript<span style="color:#000099; font-weight:bold;">\"</span>&gt;"</span> + __flash__argumentsToXML<span style="color:#006600; font-weight:bold;">&#40;</span>arguments, <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#CC0000;">"&lt;/invoke&gt;"</span>;this.<span style="">CallFunction</span><span style="color:#006600; font-weight:bold;">&#40;</span>flashFunction<span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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;">&nbsp; &nbsp; &nbsp; &nbsp; window<span style="color:#006600; font-weight:bold;">&#91;</span>movieName<span style="color:#006600; font-weight:bold;">&#93;</span> = realMovie;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#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:#006600; font-weight:bold;">&#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;">var eim = new ExternalInterfaceManager<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">eim.<span style="">registerMovie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"ShockwaveFlash1"</span><span style="color:#006600; font-weight:bold;">&#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;">eim.<span style="">registerMovie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"ShockwaveFlash2"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">eim.<span style="">initialize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#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;">&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>这样就可以一定程度上解决ExternalInterface在form标签之间会报错的问题，是asp.net开发者的福音。</p>
<h3>原理</h3>
<p>下面是浏览器载入一个包含ExternalInterface调用的flash之后，flash player可能会用到的方法</p>
<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showCodeTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<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;">function __flash__arrayToXML<span style="color:#006600; font-weight:bold;">&#40;</span>obj<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var s = <span style="color:#CC0000;">"&lt;array&gt;"</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; &nbsp; for <span style="color:#006600; font-weight:bold;">&#40;</span>var i=<span style="color:#800000;color:#800000;">0</span>; i&lt;obj.<span style="">length</span>; i++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; s += <span style="color:#CC0000;">"&lt;property id=<span style="color:#000099; font-weight:bold;">\"</span>"</span> + i + <span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\"</span>&gt;"</span> + __flash__toXML<span style="color:#006600; font-weight:bold;">&#40;</span>obj<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#CC0000;">"&lt;/property&gt;"</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; return s+<span style="color:#CC0000;">"&lt;/array&gt;"</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:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function __flash__argumentsToXML<span style="color:#006600; font-weight:bold;">&#40;</span>obj,index<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#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; &nbsp; var s = <span style="color:#CC0000;">"&lt;arguments&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for <span style="color:#006600; font-weight:bold;">&#40;</span>var i=index; i&lt;obj.<span style="">length</span>; i++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; s += __flash__toXML<span style="color:#006600; font-weight:bold;">&#40;</span>obj<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#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; &nbsp; return s+<span style="color:#CC0000;">"&lt;/arguments&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#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;">function __flash__objectToXML<span style="color:#006600; font-weight:bold;">&#40;</span>obj<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var s = <span style="color:#CC0000;">"&lt;object&gt;"</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; &nbsp; for <span style="color:#006600; font-weight:bold;">&#40;</span>var prop in obj<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; s += <span style="color:#CC0000;">"&lt;property id=<span style="color:#000099; font-weight:bold;">\"</span>"</span> + prop + <span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\"</span>&gt;"</span> + __flash__toXML<span style="color:#006600; font-weight:bold;">&#40;</span>obj<span style="color:#006600; font-weight:bold;">&#91;</span>prop<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#CC0000;">"&lt;/property&gt;"</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; return s+<span style="color:#CC0000;">"&lt;/object&gt;"</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:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function __flash__escapeXML<span style="color:#006600; font-weight:bold;">&#40;</span>s<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#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; &nbsp; return s.<span style="">replace</span><span style="color:#006600; font-weight:bold;">&#40;</span>/&amp;/g, <span style="color:#CC0000;">"&amp;amp;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">replace</span><span style="color:#006600; font-weight:bold;">&#40;</span>/&lt;/g, <span style="color:#CC0000;">"&amp;lt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">replace</span><span style="color:#006600; font-weight:bold;">&#40;</span>/&gt;/g, <span style="color:#CC0000;">"&amp;gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">replace</span><span style="color:#006600; font-weight:bold;">&#40;</span>/<span style="color:#CC0000;">"/g, "</span>&amp;quot;<span style="color:#CC0000;">").replace(/'/g, "</span>&amp;apos;<span style="color:#CC0000;">");</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">}</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:#CC0000;">function __flash__toXML(value) {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp;var type = typeof(value);</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:#CC0000;">&nbsp; &nbsp; if (type == "</span>string<span style="color:#CC0000;">") {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; return "</span>&lt;string&gt;<span style="color:#CC0000;">" + __flash__escapeXML(value) + "</span>&lt;/string&gt;<span style="color:#CC0000;">";</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:#CC0000;">&nbsp; &nbsp; } else if (type == "</span>undefined<span style="color:#CC0000;">") {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; return "</span>&lt;undefined/&gt;<span style="color:#CC0000;">";</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:#CC0000;">&nbsp; &nbsp; } else if (type == "</span>number<span style="color:#CC0000;">") {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; return "</span>&lt;number&gt;<span style="color:#CC0000;">" + value + "</span>&lt;/number&gt;<span style="color:#CC0000;">";</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:#CC0000;">} </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>可以认为现在的ExternalInterface Class仅仅只是可用而已，不够成熟</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/222/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>用javascript实现的socket客户端</title>
		<link>http://www.ooso.net/archives/190</link>
		<comments>http://www.ooso.net/archives/190#comments</comments>
		<pubDate>Sat, 22 Jul 2006 02:32:27 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/190</guid>
		<description><![CDATA[用javascript实现的socket客户端?没错,而且不依赖java applet之类的作弊手段.这里有个例子：socketjs.它的巧妙之处是在页面中内嵌入了一个大概300字节的flash,利用javascript来操纵flash的xmlSocket client,这样就实现了一个伪socket客户端。在flash和javascript结合的越来越紧密的今天，我们已经看到许多这样类似的应用。我们可以利用这个socketJs来实现一些多人的基于web的即时通讯程序如聊天室，互动游戏之类的。

				<span class="readmore"><a href="http://www.ooso.net/archives/190" title="用javascript实现的socket客户端">阅读全文（580字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>用<a href="http://www.ooso.net/index.php/archives/category/javascript/">javascript</a>实现的socket客户端?没错,而且不依赖java applet之类的作弊手段.这里有个例子：<a href="http://dev.dschini.org/socketjs/">socketjs</a>.它的巧妙之处是在页面中内嵌入了一个大概300字节的flash,利用javascript来操纵<a href="http://www.ooso.net/index.php/archives/category/flash/">flash</a>的xmlSocket client,这样就实现了一个伪socket客户端。在flash和javascript结合的越来越紧密的今天，我们已经看到许多这样类似的应用。我们可以利用这个socketJs来实现一些多人的基于web的即时通讯程序如聊天室，互动游戏之类的。</p>
<p>socketJs目前有如下可调用的api</p>
<p><code>function SocketConnect(host,port){}<br />
function SocketSend(data){}<br />
function SocketClose(){}<br />
function SocketOnInit(){}<br />
function SocketOnConnect(success){}<br />
function SocketOnData(data){}<br />
function SocketOnClose(){} </code></p>
<h1>注意要点</h1>
<ul>
<li>php也可以构建socket server,请看手册<a href="http://cn.php.net/manual/en/ref.sockets.php">http://cn.php.net/manual/en/ref.sockets.php</a></li>
<li>通过flash的xmlSocket client的发送的xml，应该用”\0\n”结尾，切记切记</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/190/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>如何编译red5 0.4 &#8211; 视频教程</title>
		<link>http://www.ooso.net/archives/176</link>
		<comments>http://www.ooso.net/archives/176#comments</comments>
		<pubDate>Thu, 30 Mar 2006 08:36:49 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[red5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/176</guid>
		<description><![CDATA[这三个flash的视频教程演示了如何编译red5 server 0.4,用到的工具有eclipse,subversion,ant等等.

用svn获取Red5源程序
使用eclipse来过滤源文件列表,使之更可读

				<span class="readmore"><a href="http://www.ooso.net/archives/176" title="如何编译red5 0.4 &#8211; 视频教程">阅读全文（178字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>这三个flash的视频教程演示了如何编译<a href="http://www.newviewnetworks.com/nvnhome/blog/client/" target="_blank">red5</a> server 0.4,用到的工具有<a href="http://www.eclipse.org" target="_blank">eclipse</a>,<a href="http://subversion.tigris.org/" target="_blank">subversion</a>,<a href="http://ant.apache.org/" target="_blank">ant</a>等等.</p>
<ul>
<li><a href="http://www.newviewnetworks.com/nvnhome/blog/client/media/20060326_checkout.htm" target="_blank">用svn获取Red5源程序</a></li>
<li><a href="http://www.newviewnetworks.com/nvnhome/blog/client/media/20060326_02_cleanup.htm" target="_blank">使用eclipse来过滤源文件列表,使之更可读</a></li>
<li><a href="http://www.newviewnetworks.com/nvnhome/blog/client/media/20060327_03_build.htm" target="_blank">用ant来编译源程序,并运行red5 server</a></li>
</ul>
<p>什么是red5?<br />
red5是一个开源的flashcom server端</p>
<p>相关文章:<a href="http://www.ooso.net/index.php/archives/152">Red5 0.3 Released</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/176/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Red5 0.3 Released</title>
		<link>http://www.ooso.net/archives/152</link>
		<comments>http://www.ooso.net/archives/152#comments</comments>
		<pubDate>Tue, 21 Feb 2006 04:56:14 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[red5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/152</guid>
		<description><![CDATA[开源的flashcom server端Red5发布了0.3版,这好像是第一个公开发布的版本.

Red5 0.3 Documentation
Red5项目主页以及demo
]]></description>
			<content:encoded><![CDATA[<p>开源的flashcom server端<a href="http://www.newviewnetworks.com/nvnhome/blog/client/" target="_blank">Red5</a>发布了0.3版,这好像是第一个公开发布的版本.</p>
<ul>
<li><a href="http://www.newviewnetworks.com/nvnhome/blog/client/media/Red5%20Manual%200.3.swf" target="_blank">Red5 0.3 Documentation</a></li>
<li><a href="http://www.newviewnetworks.com/nvnhome/blog/client/" target="_blank">Red5项目主页以及demo</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/152/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>好久没玩flash</title>
		<link>http://www.ooso.net/archives/97</link>
		<comments>http://www.ooso.net/archives/97#comments</comments>
		<pubDate>Sat, 03 Aug 2002 08:33:48 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">/?p=97</guid>
		<description><![CDATA[抓紧时间操练了一把,用下面代码作了一个粉简单的坦克控制:)
PLAIN TEXT
ACTIONSCRIPT:


				<span class="readmore"><a href="http://www.ooso.net/archives/97" title="好久没玩flash">阅读全文（875字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>抓紧时间操练了一把,用下面代码作了一个粉简单的坦克控制:)</p>
<div class="igBar"><span id="lactionscript-14"><a href="#" onclick="javascript:showCodeTxt('actionscript-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-14">
<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: #000000; font-weight: bold;">class</span> Move <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</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;">&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;">&nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> speed = <span style="color: #cc66cc;color:#800000;">3</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> xMin = <span style="color: #cc66cc;color:#800000;">0</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;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> yMin = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> xMax = <span style="color: #cc66cc;color:#800000;">400</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;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> yMax = <span style="color: #cc66cc;color:#800000;">400</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;">&nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onLoad</span><span style="color: #66cc66;">&#40;</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;">&nbsp; <span style="color: #0066CC;">Key</span>.<span style="color: #0066CC;">addListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</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; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xMin</span> += <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_width</span>/<span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xMax</span> -= <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_width</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; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">yMin</span> += <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_height</span>/<span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">yMax</span> -= <span style="color: #0066CC;">this</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;<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;">&nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onEnterFrame</span><span style="color: #66cc66;">&#40;</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;">&nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> &lt;this.<span style="color: #006600;">xMin</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;">&nbsp; &nbsp;<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xMin</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <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; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>._x&gt; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xMax</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;">&nbsp; &nbsp;<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">xMax</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; <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; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> &lt;this.<span style="color: #006600;">yMin</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;">&nbsp; &nbsp;<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">yMin</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <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; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>._y&gt; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">yMax</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;">&nbsp; &nbsp;<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">yMax</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; <span style="color: #66cc66;">&#125;</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<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;">&nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setSpeed<span style="color: #66cc66;">&#40;</span>speed:<span style="color: #0066CC;">Number</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;">&nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</span> = speed;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<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;">&nbsp;<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onKeyDown</span><span style="color: #66cc66;">&#40;</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;">&nbsp; <span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Key</span>.<span style="color: #0066CC;">getCode</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp;<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;color:#800000;">83</span>: <span style="color: #808080; font-style: italic;">// s</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; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_rotation</span> = <span style="color: #cc66cc;color:#800000;">180</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> += <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</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; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;color:#800000;">65</span>: <span style="color: #808080; font-style: italic;">// a</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_rotation</span> = -<span style="color: #cc66cc;color:#800000;">90</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; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> -= <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">break</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; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;color:#800000;">68</span>: <span style="color: #808080; font-style: italic;">// d</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; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_rotation</span> = <span style="color: #cc66cc;color:#800000;">90</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> += <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</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; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &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;">&nbsp; &nbsp;<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;color:#800000;">87</span>: <span style="color: #808080; font-style: italic;">// w</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_rotation</span> = <span style="color: #cc66cc;color:#800000;">0</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; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> -= <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <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;<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;">&nbsp;<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onRelease</span><span style="color: #66cc66;">&#40;</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;">&nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>’test’<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;<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>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/97/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
