将应用程序从 Flex3 迁移到 Flex 4 的优点和缺点是什么?

发布于 2024-10-24 14:02:32 字数 134 浏览 1 评论 0原文

在从 Flex 3 迁移到 Flex 4 的过程中,我发现了很多问题。我在 Flex 3 中完成了一些逻辑,但在将相同的代码迁移到 Flex4 时,它不起作用。请帮助我了解如何进行精确的迁移,或者有任何工具可以将代码从 Flex3 迁移到 Flex 4。

I had many issues found in migration from Flex 3 to Flex 4. I had done some logic in flex 3 but while migrating the same code to flex4 it is not working. Please help me out how to do the exact migrating or have any tool for migrating the code from flex3 to flex 4.

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

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

发布评论

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

评论(2

浊酒尽余欢 2024-10-31 14:02:32

Flex 4 有很多优点,其中之一就是外观,这对于代码重用来说是一个巨大的优势,而且还可以分离关注点(将视图/样式与组件行为分开)。还有 FXG(基于 mxml 的矢量),可以与 Catalyst 一起使用,轻松地为 illustrator 中的组件换肤。

Flex 4 绝对是未来,也是您应该努力的目标,但它确实带来了很多变化,因此这里的缺点是,如果不重做一些代码,很难将 Flex 3 应用程序转换为 Flex 4。这是完全不同的心态,需要坚持。

没有快速的工具来转换您的组件逻辑。

There are many advantages of Flex 4, one of which is Skinning, which is a huge plus for code reuse but also separation of concerns (separate the view/styling from the component behavior). There's also FXG (mxml based vectors) that can be used with Catalyst to easily skin components from illustrator.

Flex 4 is definitely the future and what you should strive for, but it does bring forth a lot of changes, so the con here is that it's very hard to convert a Flex 3 app to Flex 4 without redoing some code. It's a different mentality altogether and it needs to be adhered.

There are no quick tool to convert your component logic.

可是我不能没有你 2024-10-31 14:02:32

根据我的经验,当迁移到 Flex 4 时,我必须在项目中修复的大多数问题都与部分代码有关,这些代码实际上是为了解决 Flex 3 中组件缩放/调整大小的一些奇怪行为而在 Flex 4 中得到解决的总的来说,这并不难,逻辑上没有重大变化,只是改进和修复了一些错误,并且可能很少出现新错误:)

迁移到 Flex 4 时,无需将组件更改为 Spark ,您仍然可以使用 MX 结构。
新组件使用不同的布局,您构建它们的方式略有不同
* 你不能像在 MX 中那样使用 Spark 的 ComboBox/DropDownList,因为你需要 IList 对象作为数据提供者
* 在 MX 和 Spark 组件中,调整大小/缩放和测量可以正常工作
* 您无法像在 Flex 3 中那样直接将某些 MX 组件添加到 Spark 容器
* 对于 Spark 组件,您使用 addElement 而不是 addChild
* 在 Flex 4 中,他们引入了 FTE,具有卓越的文本渲染质量,解除了 127px 字体大小的限制,但现在如果您在运行时嵌入字体(我这样做),则必须使用 CFF 标志

我认为迁移到 Flex 4 值得麻烦,如果您决定使用最新的 SDK 版本 (4.5),您可能会遇到一些问题,目前 4.1 是一个更安全的调用,尽管我使用 4.5 知道风险。

On my expirience most of the things I had to fix on my project when migrated to Flex 4 were related to parts of code that were actually work arounds for some strange behaviour with scaling/resizing of components in Flex 3, which was resolved in Flex 4. Overly it wasn't hard, there are no major changes in logic, just improvements and some bugs fixed, and possibly few new bugs made :)

When migrating to Flex 4 it's not neccessary to change your components to Spark ones, you can still use your MX structure.
New components use a different layout, you build them a bit differently
* you cant use Spark's ComboBox/DropDownList as in MX, since you need IList objects as data provider
* Resize/Scale and measures work as they should now, in both MX and Spark components
* you can't add directly some of MX components to Spark containers as you could in Flex 3
* you use addElement instead addChild for Spark components
* in Flex 4 they introduced FTE, with superior text render quality, lifting the limit of 127px font size, but now if you embed fonts on runtime (I do) you have to use CFF flag

I think that migrating to Flex 4 worth the hassle, just if you decide to use the latest SDK build (4.5) you may encounter some issues, 4.1 is a safer call at the moment, tho I'm using 4.5 knowing of the risks.

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