我正在使用ASDocr,它是命令行Flex asdoc
文档生成器的Adobe AIR应用程序GUI界面。我的类使用了几个外部库,在创建文档时产生了1046错误:
/Users/mga/Documents/FDT Workspace/vgline/src/com/pingpongestudio/timeline/Timeline.as(1569): col: 39 Error: Type was not found or was not a compile-time constant: SWFAddressEvent.
private function handleSWFAddress(e:SWFAddressEvent):void {
^
正如您所看到的,我正在使用SWFAddress
但只有SWFAddressEvent
类会引发错误。该类(Timeline.as)的第40和41行是:
import com.asual.swfaddress.SWFAddress;
import com.asual.swfaddress.SWFAddressEvent;
这是命令行指令:
/Applications/Adobe Flex SDK 4/bin/asdoc -source-path "/Users/mga/Documents/FDT Workspace/vgline/src" -output "/Users/mga/Documents/FDT Workspace/vgline/doc" -doc-sources "/Users/mga/Documents/FDT Workspace/vgline/src" -lenient
我的应用程序运行正常。编译错误仅在生成文档时显示。此应用程序将AS3脚本文件与FLA接口文件结合使用。
修改
我将FDT中的外部库路径添加到编译器中,现在它抛出了这个命令行指令:
/Applications/Adobe Flex SDK 4/bin/asdoc -source-path "/Users/mga/Documents/FDT Workspace/vgline/src" -output "/Users/mga/Documents/FDT Workspace/vgline/doc" -doc-sources "/Users/mga/Documents/FDT Workspace/vgline/src" -library-path+="/Users/mga/Desktop/stuff/as3 classes/dashedline" -library-path+="/Users/mga/Desktop/stuff/as3 classes/webdevils" -library-path+="/Users/mga/Desktop/stuff/as3 classes/as3corelib-.92.1/src" -library-path+="/Users/mga/Desktop/stuff/as3 classes/swfaddress-2.4/dist/as/3" -library-path+="/Applications/Adobe Flex SDK 4/frameworks/libs/player/10/playerglobal.swc" -library-path+="/Applications/Adobe Flex SDK 4/frameworks/libs/flex.swc" -library-path+="/Applications/Adobe Flex SDK 4/frameworks/libs/framework.swc" -library-path+="/Applications/Adobe Flex SDK 4/frameworks/libs/rpc.swc" -library-path+="/Applications/Adobe Flex SDK 4/frameworks/libs/utilities.swc" -library-path+="/Users/mga/Desktop/stuff/as3 classes/greensock-tweening-platform-as3" -lenient
生成的错误是相同的。
如果我尝试排除依赖项,我会收到“错误:排除依赖项不能与doc-sources一起使用。”
答案 0 :(得分:1)
调用应用程序时需要包含-library-path
参数,并包含“/ Users / mga / Documents / FDT Workspace / vgline / libs”或每个swc或swf文件的位置引用。
您可能还想使用-exclude-dependencies
标志来避免为第三方库生成文档。