【转】asDoc生成文档二三事

一、FlashBuilder生成方法:
具体设置请看截图:




1.选择“外部工具配置”

 




2. 新建一个外部配置








3.编辑外部配置:
   位置:填写asdoc.exe的路径,也可通过“浏览文件系统”找到对应文件
   工作目录:选择你需要生成的asdoc的项目中的目录
   自变量:-source-path . (这里的“点号”代表本目录中)    -doc-sources .\main (这里是填写需要生成asdoc的文件目录或文件)
                 -external-library-path "D:\**\aa.swc" (这里是填写额外的类库路径)

4.至此,asDoc的外部配置已经完成,现在可以点击“运行”生成doc文件了。

当配置完毕后,点击运行,如果没有ASDoc语法错误的话,就会在Flash Builder 4的控制台上面打印如下的内容。
Loading configuration file I:\Program Files\Adobe\Flash Builder Beta\sdks\4.0.0\frameworks\flex-config.xml
Documentation was created in E:\04-Flex\01-work\Flex4\KUI\src\asdoc-output\


二、FlashDevelop生成方法:




1.打开工具->Flash工具->Documentation Genaerator...选项








2.填写必要的参数

Page title: 页面标题,通常与项目名称相同

Output directory: doc输出路径

Classpaths:需要生成doc的类路径,可通过右侧"Browse"选择出。

Extra options:额外参数,如果需要swc类库,需要添加参数 -external-library-path "类库路径名\*.swc"

Copliler:编译语言,需要编译的是as2还是as3。

----以上参数设置好后,点击"Generate"按钮,开始生成doc文档




3.可切换到Output选项卡中,查看生成的状态。

三、asDoc 标签的使用
具体请参看:http://hi.baidu.com/vim888/blog/item/f8cbd812f08ab8c5c2fd7839.html

四、一个例子文件
package test
{
    import flash.display.Sprite;
  
  
    public class tt1 extends Sprite {
        /
        public function setSize(w:int, h:int=0):int {
            return 0;
        }
      
        public function setTxtFormat(size:int, color:uint, font:String = "Arial"):void{
          
        }
        //------------------------------set|get funs----------------------------------
      
        public function get size():int { return _size; }
        public function set size(value:int):void {
            _size = value;
        }
    }
}
该文件生成的doc截图如下:




你可能感兴趣的:(生成)