防止Flex库项目中的MXML自定义组件始终位于默认包中?

发布于 2024-08-27 00:49:53 字数 274 浏览 2 评论 0原文

我正在创建一些自定义组件和支持代码。我在 Flash Builder 中创建了一个 Flex 库项目,该项目可编译为 SWC。现在的问题是,我所有的 MXML 文件都被编译成默认包中的类,使整个事情变得一团糟。

有没有办法为 MXML 文件设置包声明?毕竟它只是被翻译成 AS3 类。这似乎可以在使用命名空间声明的常规 Flex 项目中工作,所以我不知道它应该如何工作。

另一种选择是在 AS3 中构建所有组件,这是我想避免的。

有什么想法吗?非常感谢。

干杯, 雅各布

I'm creating some custom components and backing code. I've created a Flex library project in Flash Builder which compiles to a SWC. The problem is now that all my MXML files get compiled into classes in the default package, making the whole thing a big mess.

Is there a way to set a package declaration for MXML files? After all it just gets translated into AS3 classes. This seems to work in regular Flex projects using a namespace declaration so I'm at a loss how that is supposed to work.

The other option is building out all the components in AS3 which I'd like to avoid.

Any ideas? Many thanks in advance.

Cheers,
Jakob

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

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

发布评论

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

评论(1

ぺ禁宫浮华殁 2024-09-03 00:49:53

好吧,经过三个小时阅读 Adob​​e 数据库中的错误后我找到了答案。这似乎是 Flash Builder Beta 2 中的一个错误:http://bugs.adobe。 com/jira/browse/FB-23453 (实际上有几个类似的报告)

在您的库项目中的“Flex Library Build Path”下 ->; “类”使用选项“选择要包含在库中的类”而不是“包含所有源路径中的所有类”。这解决了很多问题,从描述的打包问题到与manifest.xml相关的问题,例如“在名称空间 FOOBAR 中找不到类 foo.Bar 的源”。

希望这可以节省您在这个问题上浪费的时间。

Ok, after three hours of reading bugs in Adobe's database I figured it out. It seems to be a bug in Flash Builder Beta 2: http://bugs.adobe.com/jira/browse/FB-23453 (There's actually several similar reports)

In your library project under "Flex Library Build Path" -> "Classes" use option "Select classes to include in library" instead of "Include all classes from all source paths". This fixes a whole lot of problems, ranging from the packaging problems described about to manifest.xml related problems like "could not find source for class foo.Bar in namespace FOOBAR".

Hope that saves you the time I just wasted on that issue.

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