Sublime2下编译AS3代码

2019-12-31 19:04:44

<p>还有不到5个小时就2020了,Flash这么快的要终结了么.<a href="http://finance.sina.com.cn/roll/2019-08-23/doc-ihytcern2907316.shtml" rel="noopener noreferrer" target="_blank">http://finance.sina.com.cn/roll/2019-08-23/doc-ihytcern2907316.shtml</a></p><p><br></p><p>环境:sublime2, win7,flex4.7(64bit)</p><p><br></p><p>1.先来段熟悉的代码,ActionScript3, 存为bytes.as</p><pre class="ql-syntax" spellcheck="false">package { <span class="hljs-keyword">import</span> flash.display.Sprite; public <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">bytes</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Sprite</span> </span>{ public <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">bytes</span>() </span>{ <span class="hljs-keyword">super</span>(); trace(<span class="hljs-string">"goodbye flash..."</span>); } } } </pre><p>2. 打开SublineText2 , 选择"工具"-&gt; "编译系统"->新建个"ActionScript3" </p><p> 加上以下代码:</p><pre class="ql-syntax" spellcheck="false">{ <span class="hljs-string">"cmd"</span>: [<span class="hljs-string">"D:\\Program Files (x86)\\Sublime Text 2\\Data\\Packages\\ActionScript\\buildflash.bat"</span>,<span class="hljs-string">"${file}"</span>], <span class="hljs-string">"encoding"</span>: <span class="hljs-string">"GBK"</span> } </pre><p><br></p><p>3.buildflash.bat为编译脚本,内容如下:(也忘了是哪里抄的代码...)</p><p>注意:64位的JDK环境,要切换成32位的,本人用的jdk1.6.0, 不知道什么是JDK的,自己百度去</p><p><br></p><pre class="ql-syntax" spellcheck="false">@ECHO Compiling %~nx1……&nbsp; <span class="hljs-keyword">set</span> JAVA_HOME=D:\Runtime\Java\jdk1.6.0_10 <span class="hljs-keyword">set</span> PATH=%PATH%;%%JAVA_HOME%%\bin;%%JAVA_HOME%%\jre\bin <span class="hljs-keyword">set</span> CLASSPATH=.;%%JAVA_HOME%%\lib\dt.jar;%%JAVA_HOME%%\lib\tools.jar mxmlc.exe -load-config D:\\git\\as3test\\flex-config.xml -debug=true %~nx1 @echo start %~n1.swf flashplayer.exe %~n1.swf </pre><p><br></p><p>4.编译工具配置:</p><p>mxmlc.exe为 flexsdk下的编译命令,指定至环境变量下即可,位置:Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\bin</p><p>flashplayer.exe 为Macromedia,去年是adobe的 Flash播放器,官网下载一个</p><p>flex-config.xml 后续补上,可以先百度找个(博客还不支持非图片附件...building...)</p><p><br></p><p>5.ctrl+B编译之,很好,调试框里显示已经生成bytes.swf</p><p><br></p><p><img src="http://www.shareme.cn/attachments/month_20191231/4debb4d4aa12c22e00ca0829a55b3909.png"></p><p><br></p><p>6.但是,...如何查看经典的trace信息呢</p><p><br></p><p>目前只能借助:<a href="https://code.google.com/archive/p/flash-tracer/downloads" rel="noopener noreferrer" target="_blank" style="color: rgb(68, 68, 68);">Vizzy Flash Tracer</a> (要科学上网)</p><p><br></p><p><img src="http://www.shareme.cn/attachments/month_20191231/40e7b0ba53729fed92c5dcba1f98c501.png"></p><p><br></p><p>完! Macromedia,我爱你,好怀念以前将爱好当工作的时代.最近各种闲看,一不小心看到gskinner大大ColorMatrix源码,感悟一下,很多经典永远是经典</p><p><br></p><p>ColorMatrix</p><p>http://www.gskinner.com/blog/archives/2005/09/flash_8_source.html&nbsp;</p><p><br></p><p>原创文章,转载请注明出处,来自:shareme.cn</p>