导出的 SWC 不保留自动完成功能'参数名字

发布于 2024-12-19 07:56:33 字数 480 浏览 7 评论 0原文

我正在使用 Flash CS5,并且创建了一个大型的、很少更改的框架,我不想每次在项目中使用它时都重新编译它。

我一定做错了什么,因为“自动完成”功能没有显示函数参数的名称。

例如,我有一个函数:

public class Hey {
    public function show(name:String, num:Number, data:Array):void {...}
}

我导出 SWC 文件,当我将其导入另一个项目时,该函数的自动完成显示:

show(arg0:字符串,arg1:数字,arg2:数组):void

因此,我得到的是“arg0”、“arg1”和“arg2”,而不是“name”、“num”和“data”。

我已经下载了其他 SWC 文件,自动完成功能可以正确获取名称。

我在导出时做错了什么吗?

I am using Flash CS5 and I have created a large, rarely changing framework that I don't want to be recompiled every time I use it in my projects.

I must be doing something wrong because the "auto-complete" functionality doesn't show the names of the parameters of the functions.

For example, I have a function:

public class Hey {
    public function show(name:String, num:Number, data:Array):void {...}
}

I export the SWC file and when I import it into another project, then the auto-complete for this function shows :

show(arg0:String, arg1:Number, arg2:Array):void

So, instead of "name", "num" and "data" I get "arg0", "arg1" and "arg2".

I have downloaded other SWC files and the auto-complete gets the names correctly.

Am I doing something wrong at export-time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笙痞 2024-12-26 07:56:33

我一直无法使用 Flash Pro IDE 生成 SWC,以在代码提示中提供正确的参数名称。由于某些原因,Flash IDE 要么不使用与 Flex SDK 工具包相同的编译器,要么不使用相同的编译器选项。

您可以通过创建 Flex 库项目,使用 Flash Builder 生成代码提示兼容的 SWC。 “Flex Library”的“Flex”部分有点误导。您可以使用此项目类型构建仅限 AS3 的 SWC 文件。

或者,如果您不想花钱购买 Flash Builder,您可以随时下载免费的 Flex SDK 并使用 compc 编译器为您生成 SWC。它与 Flash Builder 用于生成 SWC 的工具集相同,因此您将获得相同的代码提示功能。如果您习惯使用命令行工具,则语法非常简单:

compc -source-path . -include-classes MyCustomClass -output=MyLibrary.swc

希望有人可以发布更好的答案并证明我是错的,但我从未见过 Flash 生成的 SWC 在代码提示中包含参数。

I have never been able to get an SWC generated with the Flash Pro IDE to supply the correct parameter names in code hints. For some reason, the Flash IDE either does not use the same compiler or does not use the same compiler options as the Flex SDK toolkit.

You can generate code-hinting-compatable SWCs with Flash Builder by creating a Flex Library project. The "Flex" part of "Flex Library" is a little misleading. You can build AS3-only SWC files with this project type.

Or if you don't feel like shelling out the money for Flash Builder, you can always download the free Flex SDK and use the compc compiler to generate the SWC for you. It's the same tool set that Flash Builder uses to generate SWCs, so you will get the same code-hinting ability. The syntax is pretty straight-forward if you're used to command line tools:

compc -source-path . -include-classes MyCustomClass -output=MyLibrary.swc

Hopefully someone can post a better answer and prove me wrong, but I've never seen a Flash-generated SWC include the parameters in code-hinting.

梦里的微风 2024-12-26 07:56:33

我想您使用 debug=false 进行编译,但应该使用 debug=true 将所有必要的数据保留在 swc 中,包括参数名称。

优化库意味着在部署之前从库中删除调试和其他代码。对于不用作 RSL 的普通库,不需要优化。这是因为您可能希望在开发过程中针对库进行调试,因此您将需要库内的调试代码。而且,当您编译应用程序的发行版本时,编译器将排除调试信息,因为它链接了库中的类。

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ad5.html

I suppose you compile with debug=false but should be debug=true to keep all necessary data in swc including arguments names.

Optimizing libraries means to remove debugging and other code from the library prior to deployment. For normal libraries that you are not using as RSLs, you do not need to optimize. This is because you will likely want to debug against the library during development, so you will need the debug code inside the library. And, when you compile the release version of your application, the compiler will exclude debug information as it links the classes from the library.

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ad5.html

南城追梦 2024-12-26 07:56:33

对我来说,最简单的方法是将代码导入 Flash Develop 项目,并安装一个插件来导出 swc: http://sourceforge.net/projects/exportswc/

安装 Flash Develop 后,转到工具 » 安装软件并安装AIR SDK + ASC 2.0(Action Script Compiler 2.0)

更多信息请参见:http://www.flashdevelop.org/community/viewtopic.php ?t=2987

For me the easiest way was to import the code to a Flash Develop project, and install a plugin to export swc's: http://sourceforge.net/projects/exportswc/

After installing Flash Develop go to Tools » Install Software and install the AIR SDK + ASC 2.0 (Action Script Compiler 2.0).

Furter information here: http://www.flashdevelop.org/community/viewtopic.php?t=2987

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文