Wednesday, December 1, 2010

Flex 3 to Flex 4 conversion problems and solutions

My recently work project has Flex front-end for UI design. Following problems I faced when it is compiled by converting to Flex 4 SDK from Flex 3 SDK . I would like to share this information with all of you.


Problem
Solution
Error: The style 'dropShadowEnabled' is only supported by type 'flexlib.containers.SuperTabNavigator' with the theme(s) 'halo'.
Use dropShadowVisible  propert y instead  dropShadowEnabled
Error: The style 'borderThickness' is only supported by type 'mx.containers.VBox' with the theme(s) 'halo'.
Use borderWeight  property in BorderContainer component in Spark theme
Error: The style 'themeColor' is only supported by type 'mx.containers.VBox' with the theme(s) 'halo'.
Use ChromeColor instead of themeColor
Error: The style 'backgroundImage' is only supported by type 'mx.containers.Canvas' with the theme(s) 'halo'.
Use BorderContainer component to set background image in spark theme like this  by enclosing your component    <s:BorderContainer backgroundImage="@Embed(source='/com/tranzfinity/images/login-screen.jpg')"> <mx:Canvas  …./> </s:BorderContainer>y enclosing your componentd image in spark theme in Flex 4
Error: Incorrect number of arguments.  Expected 3.
Try with adding null value for required arguments
Error: Access of undefined property
sortCompareFunction function within mx.DataGridColumn
Ex: sortCompareFunction=
"caseinsensitivesort('displayname')"
Use it like this, sortCompareFunction="
{caseinsensitivesort('displayname')}"
(put method name enclosing curly bracket)
Error: Type was not found or was not a compile-time constant
Add Flex 4 -flexlib.swc into project 
libs


















 











Most of the Flex 3 to Flex 4 conversion problems occurs due to different default themes in Flex verions
    Flex 3  default theme is Halo theme,
    Flex 4 default theme is Spark theme.
If you want to appear Halo theme as default theme in Flax 4, use this configuration changes in flex-config.xml (flex_sdk_4\frameworks\flex-config.xml)  file in flex-sdk-4 .

<theme>
<!-- The Flex 4 default theme is Spark. -->
<!-- <filename>themes/Spark/spark.css</filename> -->
<filename>themes/Halo/halo.swc</filename>
</theme>

Tuesday, November 30, 2010

Solution for some of Flex programming problems: The class not found in jar file: mxmlc.jar

This error may occur when you switch from Flex 3 SDK to Flex 4 SDK.

To resolve this error,
copy the {FLEX_HOME}/ant/lib/flexTasks.jar file from Flex 4 SDK and replace the existing flexTasks.jar in  Ant's lib directory ({ANT_HOME}/lib)