开发者

Compiling ActionScript 3 Files from the Command Prompt

I have a file Employee.as with the following source code. I am unable to compile it from the command prompt.

package Office{
    public class Employee{
        private var _firstName:String = "";

        public function get FirstName():String{
            return _firstName;
        }

        public function set FirstName(value:String):String{
            _firstName = value;
        }
    }
}

The error which I get is:

Error: A file found in a source- path must have the same package structure '', as the definition's package, 'Office'.

Also, I want to know how to compile multiple files in a folder from the command line. I am planning to creat开发者_运维技巧e a package with multiple files to form a library which I can use in my flex projects.


I was actually using the wrong command line options. I was earlier using mxmlc but on googling I found that for compiling libraries we have to use compc.

compc -source-path . c:/flexdeploy/comps/mypackage/ 
    -output c:/jrun4/servers/flex2/flex/WEB-INF/flex/user_classes/MyButtonComp.swc 
    -include-classes mypackage.MyButton

This solved my purpose.


This is telling you that the file needs to be in a directory named Office. The package structure and the file structure (i.e. directories) must match).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜