在兼容模式下从 Flex3 迁移到 4 后的运行时问题
我们正在将 Flex-3.2 应用程序迁移到 Flex 4.1,主要是为了利用新的文本流/引擎功能。第一步,我们决定进行仅 MX 和 Flex-3 兼容模式的编译。
感谢一些有用的资源(
http://www.adobe.com/devnet/ flex/articles/flexbuilder3_to_flashbuilder4.html
< a href="http://www.adobe.com/devnet/flex/articles/flex3and4_differences_02.html" rel="nofollow noreferrer">http://www.adobe.com/devnet/flex/articles/flex3and4_differences_02.html
)我能够编译我们的应用程序。
但我发现自己对运行时差异的数量感到惊讶,从我无法将 ResultEvent.currentTarget 转换为 HTTPService 的问题(这显然是在 3.5 中引入的)到许多布局问题,再到事件分派的差异(例如,我们的遗留组件之一监听添加事件似乎不再发生)。
似乎这方面的文档很少。我想找到一个包含详细更改的列表,这样我们就不必依赖 QA 来偶然发现所有问题。
此文档列出了一些,但似乎没有详尽无遗。 有人有更好的记录更改列表吗?
谢谢 斯特凡
PS.到目前为止我找到的具体示例列表:
1) 在 Flex 4 中,add 事件未触发:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
private function notFired():void
{
trace("ADDED");
}
private function fired():void
{
trace("COMPLETE");
}
]]>
</fx:Script>
<mx:TextArea add="notFired();" creationComplete="fired();"/>
</mx:Application>
现在在 Flex 3 中执行相同操作,您将看到两个事件均触发。
显然,这是一个错误。也许可以解决这个问题,但肯定会大大降低我的水平或信任度。
2) 对话框/弹出窗口显示所有镜像内容。
一个错误好吧。解决起来很容易,但是这么明显的事情怎么可能会失败呢?
3) 注入的“Ôª”字符出现问题。
We are migrating our Flex-3.2 application to Flex 4.1, mainly to take advantage of the new text flow/engine features. In a first step we decided to go with compiling for MX-only and in Flex-3-compatibility mode.
Thanks to some helpful resources (
http://www.adobe.com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html
Any Flex 4 migration experience?
http://www.adobe.com/devnet/flex/articles/flex3and4_differences_02.html
) I am able to compile our application.
But I find myself surprised about the amount of runtime differences ranging from the problem that I cannot cast ResultEvent.currentTarget to HTTPService ( which apparently was introduced in 3.5 ) to many layout problems to differences in event dispatching ( e.g. one of our legacy components listens to the add event which it just doesn't seem to get anymore ).
It seems there is very little documentation on this. I'd like to find a list with detailed changes so that we don't have to rely on QA to stumble across hopefully all issues.
This documents lists some, but doesn't seem exhaustive.
Does someone have a better list of documented changes?
Thanks
Stefan
PS. List of concrete examples I have found so far:
1) In Flex 4 the add event is not fired:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
private function notFired():void
{
trace("ADDED");
}
private function fired():void
{
trace("COMPLETE");
}
]]>
</fx:Script>
<mx:TextArea add="notFired();" creationComplete="fired();"/>
</mx:Application>
Now do the same in Flex 3 and you'll see both events fire.
Apparently, this is a bug. Might be possible to work around this but certainly decreases my level or trust substantially.
2) Dialogs/popups show all content mirrored.
A bug as well. Easy to work around, but how could something that obvious slip?
3) Problems with injected "Ôª" chars.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让我们看看您的一些疑虑...
1) 自 Flash Player 9 发布以来,add 从来就不是一个可靠的事件。这是一个常见的错误。尝试从显示列表中创建一个影片剪辑,并在其中添加一个具有 Event.ADDED 侦听器的子剪辑。在某些情况下(不知道到底是什么情况)它不起作用(Adobe Fail)。但是,一旦您想要检测它是否已在应用程序显示列表中,请使用“added”或“addedToStage”来代替“add”flex 事件。
2)失败。检查框架的布局管理器源代码。
3)我从来没有见过这个。 (即使在兼容模式下)。你能举个例子吗?您是否检查过应用程序编码是否与您在字符串上使用的相同?也许字符串表可能由于字符编码(或者可能是您的编辑器)而造成一些混乱。尝试其他编辑器并使用 SED 在 Linux shell 上验证代码文件内容。使用 find 和 sed 您可以轻松修复它。
Let's see some of your doubts...
1) add never was a reliable event since flash player 9 release. It's a common bug. Try to create a movieclip out of displaylist and add a child in it that have the Event.ADDED listener. In some situations (don't know exactly what situation) it doesn't work (Adobe Fail). But, instead the "add" flex event, use the "added" or "addedToStage" once you want to detect if it's already in your applications display list.
2) Fail. Check the layout manager source-code of the framework.
3) I've never seen this. (Even in compatibility mode). Can you show an example? Did you check if the application encoding is the same you're using on your strings? Maybe the string table could be doing some confusion due to the characters encodings (or maybe your editor). Try other editors and verify the code file contents on a linux shell with SED. With a find and a sed you can fix it easily.