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> |
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>