<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>翼灵AS程序员之路 - ActionScript</title><link>http://www.dodochen.com/</link><description>ActionScript3.0 - </description><generator>RainbowSoft Studio Z-Blog 1.8 Arwen Build 81206</generator><language>zh-CN</language><copyright>苏ICP备07500709号 Copyright 2008-2009 专注AS-website建设. Design by Jacky.</copyright><pubDate>Thu, 09 Sep 2010 13:48:06 +0800</pubDate><item><title>swf实现本地视频录制 保存成swf</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/62.html</link><pubDate>Wed, 23 Jun 2010 19:06:03 +0800</pubDate><guid>http://www.dodochen.com/post/62.html</guid><description><![CDATA[<p><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.dodochen.com/upload/2010/6/201006231909472333.swf" width="699" height="400" play="true" loop="true" menu="true"></embed>没错 这次是保存成swf哦 我加快了输出帧频 录制后 会有意外惊喜哦 &nbsp;&nbsp;try it&nbsp;</p><p>&nbsp;下面是我同事的录制效果 哈哈 超级搞笑</p><p><param name="play" value="True" /></p><embed src="http://www.dodochen.com/upload/2010/6/201006231911210777.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="300" play="True"></embed><p>&nbsp;</p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/62.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=62</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=62&amp;key=1caaf6d7</trackback:ping></item><item><title>还是图片旋转 不过代码变得异常简单，share一下</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/60.html</link><pubDate>Mon, 21 Jun 2010 16:12:57 +0800</pubDate><guid>http://www.dodochen.com/post/60.html</guid><description><![CDATA[<p>&nbsp;<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.dodochen.com/upload/2010/6/201006211629252706.swf" width="800" height="300" play="true" loop="true" menu="true"></embed></p><p><font face="Courier New" size="2" color="#3399FF">import<font color="#333333"> be.nascom.</font>flash<font color="#333333">.display.Carousel;</font></font><br /><font face="Courier New" size="2" color="#3399FF">var<font color="#333333"> carousel : Carousel = </font>new<font color="#333333"> Carousel(300, 0);</font></font><br /><font face="Courier New" size="2" color="#333333">carousel.depthOfField = 10;</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">x</font> = <font color="#3399FF">stage</font>.<font color="#3399FF">stageWidth</font>/2;</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">y</font> = <font color="#3399FF">stage</font>.<font color="#3399FF">stageHeight</font>/2;</font><br /><font face="Courier New" size="2" color="#3399FF">addChild<font color="#333333">(carousel);</font></font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">addChild</font>(<font color="#3399FF">new</font> mc1());</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">addChild</font>(<font color="#3399FF">new</font> mc2());</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">addChild</font>(<font color="#3399FF">new</font> mc3());</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">addChild</font>(<font color="#3399FF">new</font> mc4());</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">addChild</font>(<font color="#3399FF">new</font> mc5());</font><br /><font face="Courier New" size="2" color="#333333">carousel.<font color="#3399FF">addChild</font>(<font color="#3399FF">new</font> mc6());</font></p><p>就这些 效果就出来啦。</p><p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300"></object></p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/60.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=60</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=60&amp;key=bff7f5ca</trackback:ping></item><item><title>swf实现本地视频录制 保存成flv</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/59.html</link><pubDate>Mon, 21 Jun 2010 14:03:57 +0800</pubDate><guid>http://www.dodochen.com/post/59.html</guid><description><![CDATA[<p><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.dodochen.com/upload/2010/6/699x400CS4.swf" width="699" height="400" play="true" loop="true" menu="true"></embed></p><p>源文件下载：<a href="http://www.dodochen.com/upload/2010/6/宝岛.rar" target="_blank">宝岛.rar</a></p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/59.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=59</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=59&amp;key=56a94e69</trackback:ping></item><item><title>工作小结</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/56.html</link><pubDate>Fri, 18 Jun 2010 11:03:17 +0800</pubDate><guid>http://www.dodochen.com/post/56.html</guid><description><![CDATA[<p>&nbsp;&nbsp; &nbsp;来到新公司有一个月了，做了蛮多东西，分享下案例和经验。</p><p>一个新上线网站<a href="http://runjie.allyes.com/worldcup/">runjie.allyes.com/worldcup/</a></p><p><img onload="ResizeImage(this,159)" width="300" height="159" alt="" src="http://www.dodochen.com/upload/2010/6/未标题-2.jpg" /></p><p>关于本站 经验：</p><p>1.注册登录，积分排行等分出给后台制作人员完成大大加快网站开发进程，仅仅三天即可做完。登录框用浮层方式当前页面弹出看上去是flash整站。实则JS AS通信完成。像网站快速开发人员极力推荐这种合作方式。</p><p>2.圆形拖动选择条</p><p>&nbsp;</p><p>private function move(e:MouseEvent):void&nbsp;</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>{</p><p><span class="Apple-tab-span" style="white-space:pre">			</span>var num:Number =<span class="Apple-tab-span" style="white-space:pre">	</span>ArcMath.angle(new Point(0, 0), new Point(mouseX, mouseY))</p><p><span class="Apple-tab-span" style="white-space:pre">			</span>_rotation = num;</p><p><span class="Apple-tab-span" style="white-space:pre">			</span>if (slider) {</p><p><span class="Apple-tab-span" style="white-space:pre">				</span>var sj:Number=-50</p><p><span class="Apple-tab-span" style="white-space:pre">				</span>slider.x=ArcMath.getRPoint(0,0,num,sj,sj).x</p><p><span class="Apple-tab-span" style="white-space:pre">				</span>slider.y=ArcMath.getRPoint(0,0,num,sj,sj).y</p><p><span class="Apple-tab-span" style="white-space:pre">			</span>}</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>}</p><p>&nbsp;</p><p>&nbsp;</p><p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="120" height="120"><param name="movie" value="http://www.dodochen.com/upload/2010/6/圆形选择器.swf" /><param name="quality" value="high" /><param name="play" value="True" /><embed src="http://www.dodochen.com/upload/2010/6/圆形选择器.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="120" height="120" play="True"></embed></object></p><p>3.图形变形选择框&nbsp;var tool:TransformTool=new TransformTool();这个tool设置为全局，则选择哪个addChild给哪个。这样就会实现单点选择。</p><p>用法<span class="Apple-tab-span" style="white-space:pre">	</span> * var tool:TransformTool = new TransformTool();</p><p><span class="Apple-tab-span" style="white-space:pre">	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> * addChild(tool);</p><p><span class="Apple-tab-span" style="white-space:pre">	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> * tool.target = targetDisplayObject;</p><p>点击空白处tool.target=null;</p><p>4,图层叠加方式为叠加状态时图片效果更佳。橡皮擦的橡皮擦图层时 底板要放个透明的图形衬底。</p><p>二 sony的five3D作品</p><p>&nbsp;做3d类的网站应用时候five3D首选，轻便快捷，谁用谁知道。Scene3D.addChild(sprite3D);sprite3D.addChild(sprite2D);sprite2D.addChild(mc)</p><p><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.dodochen.com/upload/2010/6/index.swf" width="1000" height="798" play="true" loop="true" menu="true"></embed></p><p>三，视频录制项目：一个原本要求FMS实现视频录制的项目 待我做好之后跟我说要用非服务器端解决方式解决，也就意味着要swf直接保存flv 我之前从不知道swf可以实现保存flv功能，摸索了很久之后才实现，特此分享，swf不仅能实现保存flv ，gif swf都可以。</p><p>关于flvEncoder 请大家google搜索SimpleFlvWriter.as即可。以后有时间我会放出两套demo；</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/56.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=56</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=56&amp;key=64b301c9</trackback:ping></item><item><title>通过URL方式传入的参数是中文 出现乱码的解决</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/54.html</link><pubDate>Mon, 22 Feb 2010 15:04:21 +0800</pubDate><guid>http://www.dodochen.com/post/54.html</guid><description><![CDATA[<p>用get方式传 是URL方式递交参数 如果里面出现中文 后台接受解析会出现乱码；post传的时候 flash默认是UTF-8就不会有乱码。</p><p>当必须用get方式传时 解决方法如下</p><p>&amp;PhotoName=&quot;+encodeURI(&ldquo;中文&quot;)</p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/54.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=54</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=54&amp;key=4dfd36a4</trackback:ping></item><item><title>AS3.0加载XML出现“#1088 文档中根元素后面的标记格式必须正确”的解决方法</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/53.html</link><pubDate>Mon, 22 Feb 2010 13:25:47 +0800</pubDate><guid>http://www.dodochen.com/post/53.html</guid><description><![CDATA[<p>问题表现：</p><p>在加载完XML文件new XML时，出现错误&ldquo;#1088 文档中根元素后面的标记格式必须正确&rdquo;</p><p>问题分析：</p><p>XML内容为ANSI编码、XML内容没错、改为new XMLList不报错</p><p>网上有人说是System.useCodePage=true，载入的数据在XML末端有时会莫明其妙跟上一串随机乱码。</p><p>问题解决：</p><p>System.useCodePage=flase(默认)，XML内容改为UTF-8编码</p><p>或</p><p>var loader:URLLoader=e.currentTarget as URLLoader; <br />var data=loader.data; <br />data=data.substr(0,data.lastIndexOf(&quot;&gt;&quot;)+1); <br />var xml:XML=new XML(data);&nbsp;</p><p>其实就是把多出的随机字符串过滤一下，因为xml必定是以'&gt;'结尾的，将最后的'&gt;'之后的字符都去掉就OK了。</p><p>useCodePage 属性&nbsp;&nbsp;</p><p><br />useCodePage:Boolean&nbsp; [read-write] <br />&nbsp;</p><p>语言版本 :&nbsp; ActionScript 3.0 <br />Player 版本 :&nbsp; Flash Player 9</p><p>一个布尔值，它告诉 Flash Player 使用哪个代码页来解释外部文本文件。 当该属性设置为 false 时，Flash Player 使用 Unicode 解释外部文本文件。 （保存这些文件时，必须使用 Unicode 对其进行编码。） 当该属性设置为 true 时，Flash Player 使用运行播放器的操作系统的传统代码页来解释外部文本文件。 useCodePage 的默认值是 false。</p><p>作为外部文件加载（使用 flash.display.Loader.load()、flash.net.URLLoader、flash.net.URLStream 或 XML 类）的文本必须已使用 Unicode 编码格式保存，这样 Flash Player 才能将它识别为 Unicode。 若要使用 Unicode 对外部文件进行编码，请在支持 Unicode 的应用程序（例如，Windows 2000 上的&ldquo;记事本&rdquo;）中保存这些文件。</p><p>如果加载的外部文本文件不是 Unicode 编码格式，则应将 useCodePage 设置为 true。 在将加载数据的 SWF 文件的第一帧中添加以下代码，使之成为第一行代码：</p><p>System.useCodePage = true;<br />有了这一行代码，Flash Player 将使用运行 Flash Player 的操作系统的传统代码页来解释外部文本。 对于英文 Windows 操作系统，该代码页通常为 CP1252；对于日语操作系统，该代码页通常为 Shift-JIS。 如果将 useCodePage 设置为 true，则 Flash Player 6 及更高版本处理文本的方式与 Flash Player 5 相同。 （Flash Player 5 将所有文本都视为使用运行播放器的操作系统的传统代码页显示文本。）</p><p>如果将 useCodePage 设置为 true，应注意：在运行播放器的操作系统的传统代码页中必须包括您的外部文本文件中使用的字符，这样才能显示文本。 例如，如果您加载了一个包含中文字符的外部文本文件，则这些字符不能显示在使用 CP1252 代码页的系统上，因为该代码页不包括中文字符。</p><p>为确保所有平台上的用户都能查看您的 SWF 文件中使用的外部文本文件，应将所有外部文本文件按 Unicode 进行编码，并保留 useCodePage 的 false 设置不变。 这样，Flash Player 6 及更高版本将按 Unicode 解释文本。</p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/53.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=53</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=53&amp;key=3038c7ba</trackback:ping></item><item><title>flash开源类库宝典</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/52.html</link><pubDate>Thu, 15 Oct 2009 13:33:08 +0800</pubDate><guid>http://www.dodochen.com/post/52.html</guid><description><![CDATA[<p>1、as3ebaylib <a href="http://code.google.com/p/as3ebaylib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3ebaylib/</font></a></p><p>2、as3youtubelib <a href="http://code.google.com/p/as3youtubelib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3youtubelib/</font></a></p><p>3、as3flickrlib <a href="http://code.google.com/p/as3flickrlib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3flickrlib/</font></a></p><p>4、Yahoo ASTRA Flash Components <a href="http://developer.yahoo.com/flash/astra-flash/" rel="nofollow"><font color="#0000cc">http://developer.yahoo.com/flash/astra-flash/</font></a></p><p>5、facebook-as3 <a href="http://code.google.com/p/facebook-as3/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/facebook-as3/</font></a></p><p>6、as3awss3lib <a href="http://code.google.com/p/as3awss3lib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3awss3lib/</font></a></p><p>7、Adobe ActionScript 3:resources:apis:libraries （官方，包括corelib、FlexUnit、Flickr、Mappr、RSS and Atom libraries、Odeo、YouTube） <a href="http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries" rel="nofollow"><font color="#0000cc">http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries</font></a></p><p>8、Tweener 用于过渡与切换的一组动画库 <a href="http://code.google.com/p/tweener/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/tweener/</font></a></p><p>9、uicomponents-as3 一组轻量级的AS3 UI组件库 <a href="http://code.google.com/p/uicomponents-as3/" rel="nofollow">http://code.google.com/p/uicomponents-as3/</a></p><p>10、as3ds AS3的数据结构实现 <a href="http://code.google.com/p/as3ds/" rel="nofollow">http://code.google.com/p/as3ds/</a></p><p>11、mecheye-as3-libraries 一组主要用于Flash 游戏开发的AS3库 <a href="http://code.google.com/p/mecheye-as3-libraries/" rel="nofollow">http://code.google.com/p/mecheye-as3-libraries/</a></p><p>12、XIFF 一套XMPP协议的AS3实现 <a href="http://svn.igniterealtime.org/svn/repos/xiff/branches/xiff_as3_flexlib_beta1/" rel="nofollow"><font color="#0000cc">http://svn.igniterealtime.org/svn/repos/xiff/branches/xiff_as3_flexlib_beta1/</font></a></p><p>13、FZip 一套AS3库，可用作对ZIP压缩文件的载入、修改与创建 <a href="http://codeazur.com.br/lab/fzip/" rel="nofollow"><font color="#0000cc">http://codeazur.com.br/lab/fzip/</font></a></p><p>14、FlexLib 一套开源的Flex界面组件库 <a href="http://code.google.com/p/flexlib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/flexlib/</font></a></p><p>15、AnimatedGIfLoader Flex Component 可载入GIF的Flex组件 <a href="http://dougmccune.com/blog/animatedgifloader-flex-component/" rel="nofollow"><font color="#0000cc">http://dougmccune.com/blog/animatedgifloader-flex-component/</font></a></p><p>16、goplayground 一套轻量级的，可用创建属于你自己的AS3 动画工具的库 <a href="http://code.google.com/p/goplayground/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/goplayground/</font></a></p><p>17、AlivePDF 开源的用于PDF创建的AS3库 <a href="http://www.alivepdf.org/" rel="nofollow"><font color="#0000cc">http://www.alivepdf.org/</font></a></p><p>18、jwopitz-lib 一组开源的Flex用户界面组件 <a href="http://code.google.com/p/jwopitz-lib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/jwopitz-lib/</font></a></p><p>19、as3crypto AS3实现的一套加密库，包括多种加密算法 <a href="http://code.google.com/p/as3crypto/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3crypto/</font></a></p><p>20、flare 一套强大的可视化交互的AS3类库 <a href="http://flare.prefuse.org/" rel="nofollow"><font color="#0000cc">http://flare.prefuse.org/</font></a></p><p>21、SWFAddress 一小而强大的库，可以为Flash和Ajax提供深链接的功能 <a href="http://www.asual.com/swfaddress/" rel="nofollow"><font color="#0000cc">http://www.asual.com/swfaddress/</font></a></p><p>22、SWFObject 用于嵌入Flash，Adobe官方也认可了 <a href="http://code.google.com/p/swfobject/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/swfobject/</font></a></p><p>23、ulse Particle System 一套开源的强大的AS3动态粒子系统 <a href="http://code.google.com/p/pulse-particle/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/pulse-particle/</font></a> <a href="http://www.rogue-development.com/pulseParticles.html" rel="nofollow"><font color="#0000cc">http://www.rogue-development.com/pulseParticles.html</font></a></p><p>24、SpringGraph Flex Component <a href="http://mark-shepherd.com/blog/springgraph-flex-component/" rel="nofollow"><font color="#0000cc">http://mark-shepherd.com/blog/springgraph-flex-component/</font></a></p><p>25、GoASAP AS3动画库 <a href="http://code.google.com/p/goasap/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/goasap/</font></a> <a href="http://www.goasap.org/index.html" rel="nofollow"><font color="#0000cc">http://www.goasap.org/index.html</font></a></p><p>26、asaplibrary 一套开源的Flash Actionscript3.0 RIA库 <a href="http://code.google.com/p/asaplibrary/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/asaplibrary/</font></a> <a href="http://asaplibrary.org/" rel="nofollow"><font color="#0000cc">http://asaplibrary.org/</font></a> <a href="http://asapframework.org/" rel="nofollow"><font color="#0000cc">http://asapframework.org</font></a></p><p>27、as3mathlib 开源Flex/Actionscript数学库 <a href="http://code.google.com/p/as3mathlib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3mathlib/</font></a></p><p>28、as3corelib 包含一些基础功能AS3库 <a href="http://code.google.com/p/as3corelib/" rel="nofollow">http://code.google.com/p/as3corelib/</a></p><p>29、minimalcomps 一组AS3 UI组件 <a href="http://www.bit-101.com/minimalcomps/" rel="nofollow"><font color="#0000cc">http://www.bit-101.com/minimalcomps/</font></a></p><p>30、as3gif <a href="http://code.google.com/p/as3gif/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3gif/</font></a></p><p>31、queueloader-as3 一组AS3库，用来进行资源序列载入及监测 <a href="http://code.google.com/p/queueloader-as3/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/queueloader-as3/</font></a></p><p>32、TweenMax (AS3) <a href="http://blog.greensock.com/tweenmaxas3/" rel="nofollow"><font color="#0000cc">http://blog.greensock.com/tweenmaxas3/</font></a></p><p>33、Atellis Reflection Component 一款Flex反射效果组件 <a href="http://labs.atellis.com/2007/07/11/atellis-reflection-component/" rel="nofollow"><font color="#0000cc">http://labs.atellis.com/2007/07/11/atellis-reflection-component/</font></a></p><p>34、AS3Eval 简单来说，就是用AS3实现的AS3编译器 <a href="http://%20.hurlant.com/" rel="nofollow"><font color="#0000cc">http://eval.hurlant.com/</font></a></p><p>35、 ByteArray的组件、库合集，包括liquid components、mousegesture、ASZip、GIF Player、GIF Animation Encoder、AlivePDF、Live JPEG Encoder、ScaleBitmap等 <a href="http://www.bytearray.org/?page_id=82" rel="nofollow"><font color="#0000cc">http://www.bytearray.org/?page_id=82</font></a></p><p>36、AS3C 针对AVM2虚拟机，用C#写的字节码编译器 <a href="http://code.google.com/p/as3c/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3c/</font></a></p><p>37、as3httpclientlib as3实现的http客户端 <a href="http://code.google.com/p/as3httpclientlib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3httpclientlib/</font></a></p><p>38、as3ui 一组常规的as3　ui界面库 <a href="http://code.google.com/p/as3ui/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3ui/</font></a></p><p>39、as3xls　让你在flex中可以读写Excel文件 <a href="http://code.google.com/p/as3xls/" rel="nofollow">http://code.google.com/p/as3xls/</a></p><p>40、as3flexdb 让你的flex程序可以连接到MySQL服务器，主要是使用AMFPHP来访问PHP服务器 <a href="http://code.google.com/p/as3flexdb/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3flexdb/</font></a> 这一是一篇详细使用介绍的教程 <a href="http://itutorials.ro/viewtopic.php?f=9&amp;t=7" rel="nofollow"><font color="#0000cc">http://itutorials.ro/viewtopic.php?f=9&amp;t=7</font></a></p><p>41、vivisectingmedia-as3 　一组AS3/Flex实用库，是作者在实践中总结出来的 <a href="http://code.google.com/p/vivisectingmedia-as3/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/vivisectingmedia-as3/</font></a></p><p>Actionscript 3.0 Class</p><p>1、fZip 此类可允许你载入标准的zip文件并提取里面包含的文件 <a href="http://wahlers.com.br/claus/blog/zip-it-up/" rel="nofollow"><font color="#0000cc">http://wahlers.com.br/claus/blog/zip-it-up/</font></a></p><p>2、AS3: Layout class for Flash CS3 一组用作布局的类 <a href="http://www.senocular.com/?id=2.8" rel="nofollow"><font color="#0000cc">http://www.senocular.com/?id=2.8</font></a></p><p>3、CSSLoader 该类允许Flex应用程序在运行时载入CSS <a href="http://www.rubenswieringa.com/blog/cssloader" rel="nofollow"><font color="#0000cc">http://www.rubenswieringa.com/blog/cssloader</font></a></p><p>4、AS3: QueryString 一个单例类，用来获取URL地址后所带参数值对 <a href="http://evolve.reintroducing.com/2008/07/03/as3/as3-querystring/#more-141" rel="nofollow"><font color="#0000cc">http://evolve.reintroducing.com/2008/07/03/as3/as3-querystring/#more-141</font></a></p><p>5、ActionScript 3 Contextual Menu Manager Class AS3关联菜单管理类 <a href="http://www.blog.noponies.com/archives/103" rel="nofollow"><font color="#0000cc">http://www.blog.noponies.com/archives/103</font></a></p><p>2D &amp; 3D Engine</p><p>1、APE (Actionscript Physics Engine) 物理引擎 APE 前身是as2版本的Flade，呼声很高，优点就是清晰简单，一共没有几个类：），目前版本alpha 0.45 ，有API文档和示例，教程有一篇quick start ，在Google Group上有一个论坛可以讨论。svn上一直在更新目前svn上的版本为0.5a</p><p><a href="http://www.cove.org/ape/" rel="nofollow"><font color="#0000cc">http://www.cove.org/ape/</font></a></p><p>2、Away3D <a href="http://code.google.com/p/away3d/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/away3d/</font></a></p><p>3、Papervision3D <a href="http://code.google.com/p/papervision3d/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/papervision3d/</font></a></p><p>4、Sandy 开源3D库 <a href="http://www.flashsandy.org/versions/3.0" rel="nofollow"><font color="#0000cc">http://www.flashsandy.org/versions/3.0</font></a></p><p>5、FORM 一套AS3完成的用于2D刚性物体的物理引擎 <a href="http://code.google.com/p/foam-as3/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/foam-as3/</font></a></p><p>6、Five3D 基于矢量的Flash 3D 交互动画创建 <a href="http://five3d.mathieu-badimon.com/" rel="nofollow"><font color="#0000cc">http://five3d.mathieu-badimon.com/</font></a></p><p>7、Flade (Flash Dynamics Engine) 一套开源的2D物理引擎，AS2实现 <a href="http://www.cove.org/flade/" rel="nofollow"><font color="#0000cc">http://www.cove.org/flade/</font></a></p><p>8、Box2DFlashAS3 2D物理引擎，AS3实现，基于强大的Box2D C++物理库 <a href="http://box2dflash.sourceforge.net/" rel="nofollow"><font color="#0000cc">http://box2dflash.sourceforge.net/</font></a></p><p>9、Paradox 基于Flash的第一称3D引擎 <a href="http://animasinteractive.com/propaganda/" rel="nofollow"><font color="#0000cc">http://animasinteractive.com/propaganda/</font></a></p><p>10、ND3D AS3 3D Engine 　一款简单的AS3开源3D引擎，编译后的引擎大小仅约10K <a href="http://code.google.com/p/nd3d/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/nd3d/</font></a> <a href="http://www.nulldesign.de/nd3d-as3-3d-engine/" rel="nofollow"><font color="#0000cc">http://www.nulldesign.de/nd3d-as3-3d-engine/</font></a></p><p>11、motor2 基于Box2d的AS3刚体引擎,也是2D的. 作者就是 AS3数据结构的作者，2007年最后一天发布 作者主页：<a href="http://lab.polygonal.de/motor_physics/" rel="nofollow"><font color="#0000cc">http://lab.polygonal.de/motor_physics/</font></a> 代码：<a href="http://code.google.com/p/motor2/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/motor2/</font></a></p><p>12、WOW-Engine 法国人写的，基于Sandy library的算法 3D物理引擎 <a href="http://seraf.mediabox.fr/wow-engine/as3-3d-physics-engine-wow-engine/" rel="nofollow"><font color="#0000cc">http://seraf.mediabox.fr/wow-engine/as3-3d-physics-engine-wow-engine/</font></a></p><p>FrameWorks</p><p>1、Cairngorm Adobe官方出的Flex框架 <a href="http://labs.adobe.com/wiki/index.php/Cairngorm" rel="nofollow"><font color="#0000cc">http://labs.adobe.com/wiki/index.php/Cairngorm</font></a></p><p>2、PureMVC 纯AS3框架，也有其它语言的实现 <a href="http://www.puremvc.org/" rel="nofollow"><font color="#0000cc">http://www.puremvc.org/</font></a></p><p>3、ASWing AS3 一套开源的AS3 GUI框架 <a href="http://www.aswing.org/" rel="nofollow"><font color="#0000cc">http://www.aswing.org/</font></a></p><p>4、EasyMVC 由事件驱动的MVC框架 <a href="http://projects.simb.net/easyMVC/" rel="nofollow"><font color="#0000cc">http://projects.simb.net/easyMVC/</font></a></p><p>5、Mate 基于Tag及事件驱动的Flex框架 <a href="http://mate.asfusion.com/" rel="nofollow"><font color="#0000cc">http://mate.asfusion.com/</font></a></p><p>6、ARP 基于模式（Pattern）的RIA框架，Flash平台，支持AS2和AS3 <a href="http://osflash.org/projects/arp" rel="nofollow"><font color="#0000cc">http://osflash.org/projects/arp</font></a></p><p>7、Gaia 开源的Flash前端框架，支持AS2和AS3，用于快速开发 <a href="http://www.gaiaflashframework.com/" rel="nofollow"><font color="#0000cc">http://www.gaiaflashframework.com/</font></a></p><p>8、flest Actionscript3.0/Flex应用程序框架，用来开发企业级的RIA <a href="http://code.google.com/p/flest/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/flest/</font></a></p><p>9、Gugga Flash Framework 更新至AS3 <a href="http://www.gugga.com/flashblog/" rel="nofollow"><font color="#0000cc">http://www.gugga.com/flashblog/</font></a></p><p>10、Prana 另一个提供了IOC反转控制的框架，类似著名的Spring框架 <a href="http://www.pranaframework.org/" rel="nofollow"><font color="#0000cc">http://www.pranaframework.org/</font></a></p><p>11、OpenFlux 开源的Flex组件框架，让开发Flex组件更加快速容易 <a href="http://code.google.com/p/openflux/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/openflux/</font></a></p><p>12、Degrafa 声明式的Flex图形框架，允许以MXML标签的方式绘制图形、创建皮肤，还包括对CSS的支持 <a href="http://code.google.com/p/degrafa/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/degrafa/</font></a></p><p>13、FlexMVCs 针对AS3和Flex的应用程序框架，基于PureMVC，作了些修正和精简 <a href="http://code.google.com/p/flexmvcs/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/flexmvcs/</font></a></p><p>Flash &amp; Flex Tools、Servers</p><p>1、FlexUnit Flex/Actionscript3.0单元测试框架 <a href="http://code.google.com/p/as3flexunitlib/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/as3flexunitlib/</font></a></p><p>2、Visual FlexUnit 增强的FlexUnit，支持&ldquo;可视化断言&rdquo; <a href="http://code.google.com/p/visualflexunit/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/visualflexunit/</font></a></p><p>3、RED bug debug调试控制器，让Flash、Flex、AIR应用程序更加容易 <a href="http://www.realeyesmedia.com/redbug/" rel="nofollow"><font color="#0000cc">http://www.realeyesmedia.com/redbug/</font></a></p><p>4、reflexutil 可在运行时对Flex组件进行调试 <a href="http://code.google.com/p/reflexutil/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/reflexutil/</font></a></p><p>5、FxSpy 当Flex应用程序运行时可以检测和动态的改变可视化组件属性值 <a href="http://code.google.com/p/fxspy/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/fxspy/</font></a></p><p>6、ThunderBolt 基于Firefox的Firebug插件的日志扩展，支持AS2及AS3 <a href="http://code.google.com/p/flash-thunderbolt/" rel="nofollow"><font color="#0000cc">http://code.google.com/p/flash-thunderbolt/</font></a></p><p>7、FlashTracer Firefox扩展，可以以侧栏的方式将Flash中trace()的结果显示</p><p>8、RIALogger　另一款Flex/AIR的Debug工具 <a href="http://renaun.com/blog/flex-components/rialogger/" rel="nofollow"><font color="#0000cc">http://renaun.com/blog/flex-components/rialogger/</font></a></p><p>9、Alcon 一款轻量级的AS2及AS3的Debug工具，AIR方式将Debug信息展示出来 <a href="http://blog.hexagonstar.com/alcon/" rel="nofollow"><font color="#0000cc">http://blog.hexagonstar.com/alcon/</font></a></p><p>10、GDS (Granite Data Services) 开源，提供了Adobe LiveCycle Data Services类似功能的服务器 <a href="http://www.graniteds.org/" rel="nofollow"><font color="#0000cc">http://www.graniteds.org/</font></a></p><p>Flex Explorers （大部分为Flex2版本，但同样适用于Flex3）</p><p>1、Flex3 Component Explorer Flex各类组件示例 <a href="http://examples.adobe.com/flex3/componentexplorer/explorer.html" rel="nofollow"><font color="#0000cc">http://examples.adobe.com/flex3/componentexplorer/explorer.html</font></a></p><p>2、Resize ManagerFX Explorer （此为商业作品，要收费的） <a href="http://www.teotigraphix.com/explorers/ResizeManagerFX/ResizeManagerFXExplorer.html" rel="nofollow"><font color="#0000cc">http://www.teotigraphix.com/explorers/ResizeManagerFX/ResizeManagerFXExplorer.html</font></a></p><p>3、Flex3 Style Explorer <a href="http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html" rel="nofollow"><font color="#0000cc">http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html</font></a></p><p>4、Flex2 Style Explorer（添加了Kuler功能）Flex UI组件风格定制并可输出为CSS <a href="http://www.maclema.com/content/sek/" rel="nofollow"><font color="#0000cc">http://www.maclema.com/content/sek/</font></a></p><p>5、Flex2 Style Explorer（Adobe 原始的版本） <a href="http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html" rel="nofollow"><font color="#0000cc">http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html</font></a></p><p>6、Flex2 Filter Explorer 查看各类滤镜效果并可进行设置 <a href="http://merhl.com/flex2_samples/filterExplorer/" rel="nofollow"><font color="#0000cc">http://merhl.com/flex2_samples/filterExplorer/</font></a> <a href="http://merhl.com/?p=40" rel="nofollow"><font color="#0000cc">http://merhl.com/?p=40</font></a> (AIR版本)</p><p>7、Flex2 Primitive Explorer 在Flex中创建各种简单形状</p><p><a href="http://www.flexibleexperiments.com/Flex/PrimitiveExplorer/Flex2PrimitiveExplorer.html" rel="nofollow"><font color="#0000cc">http://www.flexibleexperiments.com/Flex/PrimitiveExplorer/Flex2PrimitiveExplorer.html</font></a></p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/52.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=52</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=52&amp;key=41cb8649</trackback:ping></item><item><title>工作小结</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/45.html</link><pubDate>Mon, 20 Apr 2009 10:01:32 +0800</pubDate><guid>http://www.dodochen.com/post/45.html</guid><description><![CDATA[<p>最近手头一个工作 暂告一段落 遇到两个第一次碰到的3.0BUG，第一是3.0里面全屏后 输入文本是无法输入的，这个没找到好的解决方案，暂且搁置。第二是FLVPLAYBACK播放器组件不能在全屏中使用 否则后黑屏只出现视频的全屏。解决方法用VIDEO取代，onMetaData事件是不可缺少的，自适应外部视频宽高，获得视频长度。<br />var client:Object = new Object();<br />client.onMetaData = onMetaData;<br />videoStream.client = client;<br />function onMetaData(metaData : Object){<br />flv_player.width=flv_player.videoWidth;<br />flv_player.height=flv_player.videoHeight;<br />&nbsp;_duration = metaData.duration;<br />&nbsp;&nbsp;}<br />onMetaData 事件只会在流媒体开始播放的时候调度。<br />另外控制视频播放暂停 不能用播放器去play pause要用NetStream去play pause。判断视频结束好像也没有VideoEvent.COMPLETE事件了，只能侦听if(Math.floor(videoStream.time) == _duration),注意duration设置为整数int</p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/45.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=45</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=45&amp;key=a1ae4507</trackback:ping></item><item><title>管理事件流：确定当前事件阶段eventPhase</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/43.html</link><pubDate>Mon, 13 Apr 2009 16:05:21 +0800</pubDate><guid>http://www.dodochen.com/post/43.html</guid><description><![CDATA[<p>在侦听事件的时候 我们经常会遇到这样的问题：在外面的大按钮侦听点击事件 在里面的小按钮也侦听事件 这个时候就会出现点击小按钮 外面的大按钮侦听和里面的小按钮侦听都一起被触发的情况</p><p>经过查看addEventListener的事件参数后发现在默认情况下useCapture被设置为false；在被设置为flase时 事件阶段为冒泡阶段，那么如果在小按钮处点击。大按钮响应侦听。冒泡是从里往外的 先到小按钮，小按钮处有侦听执行再到大按钮执行侦听。<br />那么这个时候我只想小按钮响应 就要在当前事件阶段停下。<br />代码：<br />if(e.eventPhase==EventPhase.AT_TARGET){<br />&nbsp;&nbsp;&nbsp;txt.text=&quot;你按下了小按钮&quot;<br />&nbsp;&nbsp;&nbsp;trace(e.currentTarget)<br />&nbsp;&nbsp;&nbsp;}<br />不大好理解。看下面的效果吧。</p><p>下面的结构是小按钮和文本 和背景组成大按钮，对大按钮和小按钮加Click侦听；</p><p><embed src="http://www.dodochen.com/upload/2009/4/未命名-1.swf" width="550" height="400" type="application/x-shockwave-flash" play="true" loop="true" menu="true"></embed></p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/43.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=43</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=43&amp;key=24d53827</trackback:ping></item><item><title>XMLSocket</title><author>sstpc@163.com (jacky)</author><link>http://www.dodochen.com/post/39.html</link><pubDate>Mon, 30 Mar 2009 11:30:19 +0800</pubDate><guid>http://www.dodochen.com/post/39.html</guid><description><![CDATA[<p><font face="Courier New" color="#3399ff" size="2">最近在做Socket项目，贴下部分代码，以及遇到的问题记录：<br />1.安全策略问题。当服务器传来XML解析后加载访问服务器对象时，我考虑了安全策略问题，反而会报错，后来后台工程师告诉他们已经在壳子里考虑到了，我前端就不要考虑了 否则反而会出错。</font><br />2..<font face="Courier New" color="#3399ff" size="2">XMLSocket是继承IEventDispatcher的因此我们最好对他的侦听和remove重新写方法 便于管理回收。</font></p><p><font face="Courier New" color="#3399ff" size="2">3.这个问题是在项目中遇到的 与socket无关 ，就是if(DisplayObject.contains(mc))与if(mc!=null)是有区别的 具体区别在哪我还不清楚，但是后者会在removeChild的时候报错。</font></p><p><font face="Courier New" color="#3399ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private<font color="#333333"> </font>function<font color="#333333"> </font>connect<font color="#333333">():</font>void<font color="#333333"> {</font></font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_socket = <font color="#3399ff">new</font> <font color="#3399ff">XMLSocket</font>();</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_server = dataModel.socketRoot;</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_port = dataModel.socketPort;</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;configSocket(_socket);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_socket.<font color="#3399ff">connect</font>(_server,_port);</font><br /><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">private</font> <font color="#3399ff">function</font> configSocket(dispatcher:<font color="#3399ff">IEventDispatcher</font>):<font color="#3399ff">void</font> {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dispatcher.<font color="#3399ff">addEventListener</font>(<font color="#3399ff">Event</font>.CLOSE, closeHandler);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dispatcher.<font color="#3399ff">addEventListener</font>(<font color="#3399ff">Event</font>.CONNECT, connectHandler);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dispatcher.<font color="#3399ff">addEventListener</font>(<font color="#3399ff">DataEvent</font>.<font color="#3399ff">DATA</font>, receivedHandler);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dispatcher.<font color="#3399ff">addEventListener</font>(<font color="#3399ff">IOErrorEvent</font>.<font color="#3399ff">IO_ERROR</font>, ioErrorHandler);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">private</font> <font color="#3399ff">function</font> closeHandler(e:<font color="#3399ff">Event</font>):<font color="#3399ff">void</font> {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">trace</font>(<font color="#dd0000">&quot;Socket has been closed! Connect Again...&quot;</font>);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">connect</font>();</font><br /><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">private</font> <font color="#3399ff">function</font> connectHandler(e:<font color="#3399ff">Event</font>):<font color="#3399ff">void</font> {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">trace</font>(<font color="#dd0000">&quot;Socket Connected successfully!\n&quot;</font>);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_socketflashid = dataModel.socketFlashId;</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sendMsg(<font color="#dd0000">&quot;&lt;id&gt;&quot;</font>+_socketflashid+<font color="#dd0000">&quot;&lt;/id&gt;&quot;</font>);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_timer = <font color="#3399ff">new</font> <font color="#3399ff">Timer</font>(5000, 0);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_timer.<font color="#3399ff">addEventListener</font>(<font color="#3399ff">TimerEvent</font>.<font color="#3399ff">TIMER</font>, heartBeat);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_timer.<font color="#3399ff">start</font>();</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">private</font> <font color="#3399ff">function</font> heartBeat(e:<font color="#3399ff">TimerEvent</font>):<font color="#3399ff">void</font> {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sendMsg(<font color="#dd0000">&quot;&lt;ping /&gt;&quot;</font>);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">public</font> <font color="#3399ff">function</font> receivedHandler(e:<font color="#3399ff">DataEvent</font>):<font color="#3399ff">void</font> {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_xml = <font color="#3399ff">new</font> <font color="#3399ff">XML</font>(e.<font color="#3399ff">data</font>);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_xml.<font color="#3399ff">ignoreWhitespace</font> = <font color="#3399ff">true</font>;</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">if</font> (_xml.getIn==1) {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modelName=_xml.modelName;</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#3399ff">trace</font>(_xml);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadSWF(modelName+<font color="#dd0000">&quot;_default.swf&quot;</font>);</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <font color="#3399ff">else</font> {</font><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadSWF(<font color="#dd0000">&quot;default.swf&quot;</font>);</font><br /><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br /><br /><font face="Courier New" color="#333333" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font><br />&nbsp;</p>]]></description><category>ActionScript</category><comments>http://www.dodochen.com/post/39.html#comment</comments><wfw:comment>http://www.dodochen.com/</wfw:comment><wfw:commentRss>http://www.dodochen.com/feed.asp?cmt=39</wfw:commentRss><trackback:ping>http://www.dodochen.com/cmd.asp?act=tb&amp;id=39&amp;key=f9bc007f</trackback:ping></item></channel></rss>
