将编译AS3区分Debug版本和Release版本(转)
原文链接:http://www.xiaos8.com/article.asp?id=556 首先我们区分AS3的编译版本,目的是让同样的code,如果使用debug编译,则会含有很多测试代码方便调试;如果使用release编译,则不会将调试代码编译进去。 用过Visual Studio(以下简称VS)的程序员都知道,VS在编译时有个debug和release的选项,而flash builder(以下简称fb)在编译时,虽然可以选择不同路径编译,但无法像VS那样真正的区分编译版本。 下面我依然要说,fb的确没办法像VS那样真正的去区分版本进行编译,但fb可以条件编译! 什么是条件编译 一般情况下,源程序中所有的行都参加编译。但是有时希望对其中一部分内容只在满足一定条件下才进行编译,即对一部分内容指定编译条件,这就是“条件编译”。 接下来看看,我们怎么样使用条件编译来完成区分编译Debug版本和Release版本: 1、首先来看一段代码: [cc lang="actionscript"] package { import flash.display.Sprite; public class TestBuild extends Sprite { CONFIG::debug public function TestBuild() { graphics.beginFill(0xff0000,1); graphics.drawRect(0,0,100,100); } CONFIG::release public function TestBuild() { graphics.beginFill(0x0000ff,1); graphics.drawRect(0,0,100,100); } } } [/cc] 2、TestBuild有两个构造函数,不同的是一个构造函数上有CONFIG::debug,一个有CONFIG::release; 通过理解,如果是debug编译画出来的是红色的正方形,而release编译是蓝色正方形。 3、然后我们使用mxmlc命令行对这段代码进行debug编译 mxmlc src/TestBuild.as -define=CONFIG::debug,true -define=CONFIG::release,false -output bin-release/TestBuild.swf 4、得到一个swf文件,打开一看是红色正方形,的确是debug版本编译 点击播放/隐藏媒体 uploads/201004/19_115454_testbuild.swf 5、然后改一下编译参数,进行release编译 mxmlc [...]
怎么做AIR透明窗体
AIR程序配置文件请参考:http://args.cn/2009/01/detailed-configuration-file-air/
程序的配置文件HelloWorld-app.xml
1. none
2.
true…
AIR配置文件详解
<?xml version=”1.0″ encoding=”UTF-8″?> <application xmlns=”http://ns.adobe.com/air/application/1.0“> <!– Adobe AIR Application Descriptor File Template. Specifies parameters for identifying, installing, and launching AIR applications. See http://www.adobe.com/go/air_1.0_application_descriptor for complete documentation. xmlns – The Adobe AIR namespace: http://ns.adobe.com/air/application/1.0 The last segment of the namespace specifies the version of the AIR runtime required for this application to run. minimumPatchLevel – [...]

