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>