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

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


1 <mx:TileList id="TL"
2              width="200"
3              backgroundAlpha="0"
4              borderStyle="none"
5              selectable="false"
6              columnWidth="50"
7              itemRenderer="CustomRenderer"
8              click="TL_changeHandler(event)"
9 />


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 the outcome:


01 <s:DataGroup id="TL"
02              width="200"
03              itemRenderer="CustomRenderer"
04              click="completionCodesTL_changeHandler(event)"
05              >
07              <s:layout>
08                  <s:TileLayout
09                     columnWidth="50"
10                     />
11              </s:layout>
12 </s:DataGroup>
Fullstack Architect

Frontend Group
Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com