-

将编译AS3区分Debug版本和Release版本(转)

Posted by wpm on Apr 25, 2010 in ActionScript, Flash, Flex, Uncategorized

原文链接: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 [...]

Tags: , , , , , , , , , , , ,

 
-

Adobe Flex Builder 引入Flash的类

Posted by wpm on Mar 14, 2009 in Flex


Adobe Flex Builder 默认没有引入Flash的包,所以但打开有些as文件的时候会报找不到fl命名空间的错误,其实只有在flex builder里面打开【Project】-【properties】,然后设置【Actionscript Build Path】里的【Source Path】,将Flash cs3/cs4里的类所在的文件夹(一般在flash安装文件夹下面,如:D:/Program Files/Adobe/Adobe Flash CS3/zh_cn/Configuration/ActionScript 3.0/Classes)添加进来就可以用了。<br />

Tags: , ,

 
-

怎么做AIR透明窗体

Posted by wpm on Jan 26, 2009 in AIR, Tutorials

AIR程序配置文件请参考:http://args.cn/2009/01/detailed-configuration-file-air/

程序的配置文件HelloWorld-app.xml

1. none
2.
true…

snap2

Tags: , ,

 
-

AIR配置文件详解

Posted by wpm on Jan 25, 2009 in 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 – [...]

Tags: ,