Flex SDK 升级的常见问题

本文汇总了从Flex3.5迁移到Flex4过程中遇到的各种错误及其解决方案,包括样式冲突、参数数量不匹配、主题设置、资源文件路径调整等问题,并提供了详细的修改建议。
Flex 3.5 to Flex 4 migration errors and solutions

1. Declaration of style 'direction' conflicts with previous declaration in C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\libs\framework.swc(mx.controls:ComboBox).

Solution: Use the new flexlib.swc, ilog-elixir-enterprise.swc, ilog-elixir-enterprise_rb.swc in cfiChart\libs.

2. Incorrect number of arguments.Expected 3. stroke.apply(target), fill.begin(g)

Solution: Change to var rc:Rectangle = new Rectangle;
stroke.apply(target, rc, new Point(rc.left, rc.top));
fill.begin(g,rc,new Point(rc.left, rc.top));
Need to import flash.geom.Rectangle and flash.geom.Point

3. The style 'borderSides' is only supported by type 'com.ssc.cfi.publicviews.CustomizedListBase' with the theme(s) 'halo'.

Solution: Change the default theme to Halo in the Properties -> Flex Theme panel.
For other projects without this option, add <theme themeIsDefault="false" themeIsSDK="true" themeLocation="${SDK_THEMES_DIR}/frameworks/themes/Halo"/> to .actionScriptProperties under </compiler>.

4. Unable to open 'C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\projects\framework\bundles\en_US\src' cfiCairngorm

Solution: change C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\projects\framework\bundles\en_US\src
to C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\projects\framework\bundles\en_US

5. Type 1061: Call to a possibly undefined method getResourceBundle through a reference with static type Class.
Type not found issue of mx.data.DataService. (cfiCairngorm)

Solution: Change cairngorm to at least cairngorm 2.2.2 since those issues were resolved in this version.

6. Unable to resolve resource bundle "data" for locale "en_US".

Solution: Copy data.properties from C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\3.5.0\frameworks\projects\framework\bundles\en_US\src to C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\projects\framework\bundles\en_US
Add C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\projects\framework\bundles\en_US to properties-> Flex Build Path->Source path

7. Call to a possibly undefined method setSelection through a reference with static type mx.core:ITextInput.

Solution: Change var textLength:int = this.textInput.length; this.textInput.setSelection(textLength,textLength); to this.textInput.selectRange(this.textInput.selectionAnchorPosition, this.textInput.selectionActivePosition);

8. Access of undefined property null. Dates.mxml

Solution: Remove parseFunction="null" in mx:DateField

9. Access of undefined property PropertyChangeEvent. SSCChartBase.as

Solution: import mx.events.PropertyChangeEvent

10. Copy the newest fds.swc and fds_rb.swc to C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\libs

11. Change HaloDefaults.init() to HaloDefaults.init(StyleManager.getStyleManager(FlexGlobals.topLevelApplication.moduleFactory))
HaloDefaults.createSelector(selector) to HaloDefaults.createSelector(selector,StyleManager.getStyleManager(FlexGlobals.topLevelApplication.moduleFactory))

12. In SSCFlexComponents SSCAccordionBase.as
Replace mx.graphics.RoundedRectangle with mx.geom.RoundedRectangle
Add variable definition: private var overlayColor:uint;

13. VerifyError: Error #1053: Illegal override of FlexModuleFactory in mx.core.lexModuleFactory

Solution: Re-compile CSS styles with new flex sdk.

14. Replace namespace xmlns:mx="http://www.adobe.com/2006/mxml" with xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"

15. Replace mx:Script, mx:Style, mx:Array with fx:Script, fx:Style, fx:Array, etc.

16. Use the <fx:Declarations> tag to declare non-default, non-visual properties of the current class. These tags typically include effect, validator, formatter, and data service tags.

17. Add namespaces to .css files. For example, SSBaseTheme.css
@namespace s "library://ns.adobe.com/flex/spark";
@namespace "library://ns.adobe.com/flex/mx";

18. Module didn’t inherit the styles. Add FlexGlobals.topLevelApplication.moduleFactory to the fourth parameter of load function.
moduleInfo.load(ApplicationDomain.currentDomain, null, null, FlexGlobals.topLevelApplication.moduleFactory);

19. Replace Application.application with FlexGlobals.topLevelApplication.

20. Replace Stroke with SolidColorStroke.

21. In Flex 4 we no longer call the StyleManager class as a singleton (StyleManager.getStyleManager()). Instead, StyleManager implements IStyleManager2 and you can get a reference to the styleManager directly, like this:
var styleManager:IStyleManager2 = FlexGlobals.topLevelApplication.styleManager;
So in Flex 3:
var styleSheet:CSSStyleDeclaration=StyleManager.getStyleDeclaration("DragManager");
In Flex 4:
Var styleSheet:CSSStyleDeclaration = FlexGlobals.topLevelApplication.styleManager.getStyleDeclaration("mx.managers.DragManager");
FlexGlobals.topLevelApplication.styleManager.loadStyleDeclarations

22. Replace mx.collections.SummaryField with mx.collections.SummaryField2. Change method operation to summaryOperation.
Replace mx.collections.GroupingCollection to mx.collections.GroupingCollection2.

23. Bug in flex 4.1: TypeError: Error #1009: Cannot access a property or method of a null object reference.at mx.charts::AxisRenderer/calcVerticalGutters()
A reference to "lastLabel" will be null if there is only one label.
It is solved in flex 4.5.
Workaround: set canDropLabels style of AxisRenderer to false.

24. IBM Ilog Elixir 3 compatibility issue with flex 4.5.
VerifyError: Error #1053: Illegal override of dataToLocal in ilog.charts3d.charts3dClasses.CartesianChart3D.
VerifyError: Error #1014: Class ilog.charts3d.charts3dClasses::CartesianChart3D could not be found.
VerifyError: Error #1014: Class ilog.charts3d::ColumnChart3D could not be found.

25. warning: <mx:HBox id="timeBox" x="3" y="2" horizontalGap="0" verticalAlign="center" height="100%"/>
change to
<mx:HBox id="timeBox" x="3" y="2" horizontalGap="0" verticalAlign="middle" height="100%">

26. StyleManager=mx.core.FlexGlobals.toplevelApplication.styleManager

27. The swc has style defaults and is in the library-path, which means dependencies will be linked in without the styles.
This can cause applications, which use the output swc, to have missing skins. The swc should be put in the external-library-path.

Solution:modify the link type of warning SDK libraries to external in the customized flex lib.

28. CSS warning:
flex-config.xml:

<namespaces>
<!-- Specify a URI to associate with a manifest of components for use as MXML -->
<namespace>
<uri>http://ns.adobe.com/mxml/2009</uri>
<manifest>mxml-2009-manifest.xml</manifest>
</namespace>
<namespace>
<uri>library://ns.adobe.com/flex/spark</uri>
<manifest>spark-manifest.xml</manifest>
</namespace>
<namespace>
<uri>library://ns.adobe.com/flex/mx</uri>
<manifest>mx-manifest.xml</manifest>
</namespace>
<namespace>
<uri>http://www.adobe.com/2006/mxml</uri>
<manifest>mxml-manifest.xml</manifest>
</namespace>
</namespaces>
<theme>
<!-- The Flex 4 default theme is Spark. -->
<filename>themes/Halo/halo.swc</filename>
</theme>


29. XML处理上,Flex3和Flex4有点不同,例子
voXML : XML = <example>
<updateData>
<viewType>U</viewType>
</updateData>
</example>

voXML.appendChild('<queryData><viewType>P</viewType></queryData>');

在Flex3中,voXML内容如下:
<example>
<updateData>
<viewType>U</viewType>
</updateData>
<queryData>
<viewType>P</viewType>
</queryData>
</example>
在Flex4中, voXML内容如下:
<example>
<updateData>
<viewType>U</viewType>
</updateData>
<updateData>
<queryData><viewType>P</viewType></queryData>
</updateData>
</example>

解决方法:
1.voXML.appendChild(new XML('<queryData><viewType>P</viewType></queryData>'));
2.voXML.appendChild(<queryData><viewType>P</viewType></queryData>);
摘要 大量信息可能是不能避免的。当您开始运作一个电子商务公司或是财富 500强的企业,要求以报表形式传递更多信息好像永无止境。实际上,如今更多复杂客户要求报表以各种硬拷贝和软拷贝形式传递,并且需要从各种数据源中获取数据,如XML,文本文件,LDAP,关系数据库以及应用数据库。Elixir Report 迎合了您的优秀,尤其可帮助您显著减少开发专业质量报表的时间和工作量。而且,由于产品支持国际化,所以您的产品可以在全球通用。 组件列表 技术特性 ·Report Server Access API Elixir Report Server 具有一系列小而强大的Report Server Access API,允许报表请求通过编程来完成。您也可以建立报表web接口与Servlet Engine 集成,也可以与JavaMail集成,以通过电子邮件传递报表。您可以编写基于Java 2的客户端应用程序,通过API来生成报表。 ·报表请求控制器 报表请求控制器管理外部客户端的请求,如Java应用程序或servlets,将报表请求分配到多个引擎。如果请求数比并发显示引擎多,这些请求将依次排队。Report Server的所有活动都将通过控制器形成日志文件。 ·工作空间 工作空间允许不同的报表在逻辑集合中分组。例如,有一个工作空间用于行政部门的报表,另一个工作空间用于人力资源部门的报表,不同的工作空间属于不同的部门。实际上,每个部门可以设置多个工作空间。 ·服务器端并发显示引擎 服务器端并发显示引擎用来获得高性能的报表显示。显示过程作为背后服务器来运行,生成的报表可以输出到客户端或在服务器中缓存。高扩展性的引擎支持并发处理,通过调用多个显示引擎并发的生成报表。 ·数据源管理器 数据源管理器为Elixir Report 提供了接口,以从外部数据源,如RDBMS(如Oracle,IBM DB2,Sybase, Microsoft SQL Server等),XML,LDAP,Java Objects和文本文件,来提取数据。也可以在Elixir Report中定制其它数据源。 ·部署环境 Elixir Report Server引擎可以通过Servlets 部署到应用程序服务器中,如WebLogic, Tomcat, iPlanet, WebSphere等。 应用场景 适用于东方习惯的报表系统,服务器端报表引擎提供强大的计算运行支持。 运用优势 开发环境 Jbuilder/WebSphere Studio Application Developer/Visual Age for Java/Sun ONE Studio (formerly Forte for Java) 支持平台 ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Windows 95 Windows 98 Windows NT 4.0 Windows 2000 Windows ME Windows XP Linux ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 标准报价 1)专业版 7,620 元人民币 2)企业版 19,200 元人民币 * 以上报价仅供参考,具体以厂商正式报价为准。 电话 021-58549800 Email: tools@sh.grapecity.com http://www.grapecity.com/china
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值