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>

4 comments:

  1. As a fresher i got my first work as migration from flex 3 to flex 4 .i am facing a lot difficulties.
    thanks alot , i have reduced my errors to very few , by using your ideas,

    ReplyDelete
  2. Hi Anusha,

    Iam new to Flex and your post was really helpfull...

    Keep up the good work.

    Thanks,
    Shireesh

    ReplyDelete
  3. Good job Anusha,

    thanks for sharing it helped..

    ReplyDelete
  4. ...........nice


    mail2mohan.ch@gmail.com

    ReplyDelete