Understanding Flex 3 Migration Issues (Part II)

Panel Changes:

Issue during migration: Panel Skin no longer displays correctly

Cause of compatibility issue: To make skinning a Panel easier, the skin specific logic was moved into a new PanelSkin. The Panel specific code in HaloBorder was also moved into PanelSkin. The borderThicknessLeft/Right/Top/Bottom styles are now only implemented by PanelSkin. These styles used to be implemented by Panel. Panel now relies on its border skin to provide the borderMetrics, which is consistent with the rest of the controls and containers.

Fix: For your PanelSkin, if you were extending HaloBorder, Border or RectangularBorder, extend PanelSkin instead. I’ve written another post on this subject:

https://butterfliesandbugs.wordpress.com/2008/01/30/migrating-custom-panel-skins-from-flex-2-to-flex-3-moxie/

Issue during migration: With the public Flex 3 beta, my Panel skin worked, but, it doesn’t work in the released version.

Cause of compatibility issue: In the beta, we supported setting the Panel’s borderMetrics of a skin to the scale9Grid, if it was present. We removed this functionality before the release because of some problems that some users were facing.

Fix: You can’t rely on the scale9Grid of the skin to be used to layout your content.

DataGrid Changes:

Issue during migration: Your skinned DataGrid header no longer looks correct.

Cause of compatibility issue: Again, to make customizing a DataGrid header easier to skin, the logic from drawHeaderBackground is now implemented in a DataGridHeaderBackgroundSkin. In Flex 3, the headerBackgroundSkin style was added.

Fix: Extend DataGridHeaderBackgroundSkin to create a custom DataGrid skin. Then, assign this skin to the DataGrid with headerBackgroundSkin.

General Changes:

Issue during migration: A compile error like – Error: Implicit coercion of a
value of type mx.core:IUITextField to an unrelated type flash.display:DisplayObject.

Cause of the compatibility issue: In Flex 3, the protected variables that were UITextField are now of type IUITextField. These changes were done to enable versioning in Flex 3.

Fix: you need to cast the textfield to a DisplayObject.
(e.g. addChildAt(embedTextField,getChildIndex(DisplayObject(textField))); )

2 responses

  1. Great stuff! We also put some general info and links here:
    http://blogs.adobe.com/flexdoc/2008/02/migrating_from_flex_2_to_flex.html

    -matt horn
    flex docs

  2. […]Again, to make customizing a DataGrid header easier to skin, the logic from drawHeaderBackground is now implemented in a DataGridHeaderBackgroundSkin. In Flex 3, the headerBackgroundSkin style was added.[…]

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: