从 4.1.0 升级到 Flex SDK 4.5.1 会导致某些 mx 组件出现命名空间编译错误

发布于 2024-12-07 17:31:39 字数 771 浏览 7 评论 0原文

我有一个 Flash 构建器项目,正在从 SDK 4.1.0 迁移到 4.5.1。这是一个相对简单的更改(我们使用 Maven 进行构建,并且在更新到 4.5.1 依赖项后能够成功构建)。

如前所述,该项目使用 Maven 和 Flexmojos 构建得很好。问题是在 flash builder 中打开项目时。导入maven项目,然后通过运行maven flexmojos:flexbuilder构建命令将其设置为flex项目。

问题在于,当 IDE 不再接受使用 s: 命名空间指定的某些 mx 组件时,会导致错误。例如,要编译以下内容:

<s:states>
    <s:State name="normal" />
    <s:State name="disabled" />
</s:states>

s:State 必须更改为 mx 命名空间:

<s:states>
    <mx:State name="normal" />
    <mx:State name="disabled" />
</s:states>

这只是一个示例,并且仅发生在某些 Spark 命名空间组件中。这是为什么呢? 为什么使用 Flex SDK 4.1.0 可以编译正常,但使用 Flex SDK 4.5.1 则不行?导致必要的命名空间更改的原因是什么?

I have a Flash builder project that I am migrating from SDK 4.1.0 to 4.5.1. This has been a relatively easy change (we are using maven for our builds, and were able to get a successful build after updating to the 4.5.1 dependencies).

As said, the project builds fine with maven and flexmojos. The issue is when opening the project in flash builder. The maven project is imported and then set as a flex project by running the maven flexmojos:flexbuilder build command.

The issue lies when certain mx components that are specified with the s: namespace are no longer accepted by the IDE, and result in an error. For example, for the following to compile:

<s:states>
    <s:State name="normal" />
    <s:State name="disabled" />
</s:states>

s:State must be changed to the mx namespace:

<s:states>
    <mx:State name="normal" />
    <mx:State name="disabled" />
</s:states>

This is just one example, and only happens for certain spark-namespaced components. Why is this? Why does this compile OK with Flex SDK 4.1.0 but not with Flex SDK 4.5.1, and what is the cause of the necessary namespace change?

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

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

发布评论

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

评论(1

撑一把青伞 2024-12-14 17:31:39

我在使用 FlexMojos 时发现了同样的问题,因为 Adob​​e 似乎做了一些小技巧,为 mx 组件(如 State 和 Spacer)指定 Spark 命名空间。

另外,如果您使用的是 flexmojos:flexbuilder,则意味着您也在使用旧版本的 FlexMojos(3.8?)。现在有版本 4.0 (RC2),但是,flexbuilder 目标现在已被删除。

回到你的问题,我在我的项目中以另一种方式看待它(s:Spacer 在 Flash Builder 中工作,而不是在 FlexMojos 中)。就我个人而言,我认为这些命名空间不应该相交,作为开发人员,更容易指定确切的命名空间,而不必担心命名空间的欺骗。

I've found the same problems using FlexMojos because it seems that Adobe did a little trick of specifying the spark namespace for mx components (like State and Spacer).

Also, if you're using flexmojos:flexbuilder, it means you're also using an old version of FlexMojos (3.8?). There's version 4.0 now (RC2), however, the flexbuilder goal has been removed for now.

Anywho, back to your question, I see it the other way in my project (s:Spacer works in Flash Builder, not in FlexMojos). Personally, I feel that these namespace shouldn't intersect and as a developer it's easier to just specify the exact namespace and not bother with the namespace trickery.

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