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

I am currently doing some migration work for a client, migrating their Flex 3.5 application to Flex 4.5.

Occasionally, I will undoubtedly encounter bumpers…
This will be an account of those bumpers, and how I came to resolve them. This is not guaranteed to be the best solution, just the one that worked for me, usual caveats apply.

The application I am migrating is built of modules, and every time I ran the app I got an exception on UIComponent’s getStyle method. Nothing I did fixed this, until I found this link.
It describes a compiler flag, namely ‘isolate-styles’ which, when set to false, you can prevent merging of styles between the modules and the main application.

“To prevent style merges, set the isolate-styles compiler argument to false. By doing this, you might trigger type coercion errors when loading skins. Modules also might not be properly garbage collected when they are unloaded. This is because the main application’s StyleManager will maintain references to the module even after is is unloaded. When you set isolate-styes to false, if more than one module loads a style, the first one loaded wins. In this case, styles set on modules can be overridden by those set on other modules.”

Advertisements

2 Responses to Migrating Flex 3.x application to Flex 4.5 – Tip No. 1

  1. […] described in a previous post, I am currently doing some migration work for a client, migrating their Flex 3.5 application to […]

  2. […] previous posts in this series here and here, I talked about making the project compile and run before the migration process actually […]

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: