`
ch19880311
  • 浏览: 26624 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Flex SDK 升级的常见问题

    博客分类:
  • Flex
阅读更多
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>
&lt;queryData&gt;&lt;viewType&gt;P&lt;/viewType&gt;&lt;/queryData&gt;
</updateData>
</example>

解决方法:
1.voXML.appendChild(new XML('<queryData><viewType>P</viewType></queryData>'));
2.voXML.appendChild(<queryData><viewType>P</viewType></queryData>);
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics