flex3升级到flex4.1时候遇到的一个问题。Compiler error with selectedChild in Flex 4 with code that worked in Flex 3
来源:互联网 发布:nginx 时间格式 编辑:程序博客网 时间:2024/05/17 08:23
A customer filed a bug recently about a backwards compatibility issue that they ran into when trying to compile their Flex 3 application in Flex 4. Normally, your application should compile just fine, but, you might run into some behavioral differences between the two releases. However, in the case described in bug SDK-25021, your application won’t even compile! When using the ‘selectedChild’ property for any of the MX Navigators like TabNavigator, ViewStack or Accordion, you will get the following error in Flex 4:
Error: Implicit coercion of a value of type mx.core:INavigatorContent to an unrelated type flash.display:DisplayObject.
myViewStack.removeChild(myViewStack.selectedChild)
This code compiled fine in Flex 3, but, won’t compile in Flex 4. Unfortunately, we had to loosen the type of the selectedChild property to get the MX navigators working with Flex 4 Spark content. The type of selectedChild was ‘Container’, now it is ‘INavigatorContent’. In Flex 4, both the Container and NavigatorContent classes implement INavigatorContent. You will need to make some minor tweaks to your Flex 3 code to have it compiling in Flex 4.
To resolve the compile error, just cast your selectedChild property to a Container. For example, here is the Flex 3 code converted to Flex 4 code:
Flex 3: myViewStack.removeChild(myViewStack.selectedChild)
Flex 4: myViewStack.removeChild(Container(myViewStack.selectedChild))
I hope this makes the migration easier. Good luck!
- flex3升级到flex4.1时候遇到的一个问题。Compiler error with selectedChild in Flex 4 with code that worked in Flex 3
- Flex中的TextInput (1):Flex3和Flex4的不同
- 解决 Flex4 Error in Module 的问题
- Array vs. ArrayCollection in Flex 2 (with a ColdFusion Slant)
- Flex 2.0 @ Work in combination with Spring and Hibernate
- Tips for working with time zone in flex app
- How to use json with as3corelib in flex( JSON )
- 介绍Flex4当中的视窗和滚动(Introduction to viewports and scrolling in Flex 4)
- Compiler Error Message: The compiler failed with error code 128. 的问题解决
- vue中出现 There are multiple modules with names that only differ in casing的问题
- Flex 3 in Action
- command "python setup.py egg_info" failed with error code 1 in ...
- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-o2julgbe/xgboost/
- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-b2PICB/unroll/
- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-GVQWxt/ipython/
- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/q4/br030ycd5wj57
- Command "python setup.py egg_info" failed with error code 1 in ...
- Flex4:How to debug flex project in Chrome
- list.h头文件分析
- 求职尾声(大尾巴狼) 10/21
- 文件操作 API 函数介绍
- ASP.NET项目运行时报错
- chm“已取消到该网页的导航 ”或者“无法显示网页”的解决
- flex3升级到flex4.1时候遇到的一个问题。Compiler error with selectedChild in Flex 4 with code that worked in Flex 3
- 来文与复文
- ORA-12154: TNS: 无法解析指定的连接标识符
- 追随智慧3
- 脚本编写(1)
- Hibernate Annotation笔记
- 完善eclipse+pdt作php开发中的代码提示能力
- 面试官眼中的面试
- VMware虚拟机和宿主机共享文件夹 【图】【文】