Migrating Flex 3.x application to Flex 4.5 – Tip No. 3

In previous posts in this series here and here, I talked about making the project compile and run before the migration process actually begins.

The next few posts will be dedicated to common errors that arise from moving to Flex 4.5 SDK and Spark Theme.
First, let me explain why those errors arise. When changing the compiler SDK to Flex 4.5 some errors arise and are easily fixed.

 When you change the theme to Spark Theme, some styles are no longer supported for mx components.
If you plan a complete migration, you will replace those with Spark equivalents and all will be good.
If, however, you only plan a partial migration, then you won’t necessarily replace all components but you will have to handle those errors.

The first one will be borderThickness and backgroundAlpha styles, which are no longer available for some mx compoments under the spark theme.
Let’s review an example (code was modified to protect customer code):

<mx:TileList id="TL"
             width="200"
             backgroundAlpha="0"
             borderStyle="none"
             selectable="false"
             columnWidth="50"
             itemRenderer="CustomRenderer"
             click="TL_changeHandler(event)"
/>

Tilelist does not support the backgroundAlpha style under the spark theme, so this code had to be modified.
I replaced the TileList with a DataGroup since I wanted the backgroundAlpha=”0″ and borderStyle=”none” DataGroup fit like a glove. I kept the itemRenderer and the click handler, and just added a layout and I was done.
Here is a outcome:

<s:DataGroup id="TL"
             width="200"
             itemRenderer="CustomRenderer"
             click="completionCodesTL_changeHandler(event)"
             >

             <s:layout>
                 <s:TileLayout
                    columnWidth="50"
                    />
             </s:layout>
</s:DataGroup>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: