Personal tools

Views

Flex 4:Backward Compatibility

From Adobe Labs

This page tracks compatibility issues in Flex 4 Beta 2 (Gumbo) with Flex 3.4.

Table of contents


Flex 4 Beta 2 Changes Supported By The Backwards Compatibility Flag

The following changes are all supported by the -compatibility-version compiler flag. This flag will turn off the new behavior and revert back to the version that you specified.


Brief Summary Behavior in 3.x Behavior in Gumbo When will a user encounter this issue? Reference
The default Application background changed The default background was a gradient gray/blue. The default background was a solid white. This will affect applications that did not set the backgroundColor on their Application. None
UIComponent layout-related properties are changed from post-scale to pre-transform. The following properties work with values that are post-scale in regards to the last commited scale on UIComponent: width, height.

The following properties are pre-scale during measure, but are post-scale in regards to the commited scale after measure:

explicitWidth, explicitHeight, explicitMinWidth, explicitMinHeight, explicitMaxWdith, explicitMaxHeight, measuredWidth, measuredHeight, measuredMinWidth, measuredMinHeight .

The following properties work with pre-transform (pre-scale) coordinates:

width, height, explicitWidth, explicitHeight, explicitMinWidth, explicitMinHeight, explicitMaxWdith, explicitMaxHeight, measuredWidth, measuredHeight, measuredMinWidth, measuredMinHeight

Anytime user changes scale on UIComponent there will be slight Flex3 vs. Flex4 difference in positioning/sizing due to rounding errors. Difference is tiny, but may be noticed in text anti-aliasing. Difference may increase with the number of changes to the scale properties.

Anytime there's scale set on UIComponent and users rely on one of these properties.

Examples: custom containers that arrange children will need to be updated to support scaled children.

svn revision 3411
Effect end-state values are set when effect is complete. An effect overrode values and animated to whatever values they set. Effects set their end-state value when an effect is done. svn revision 3601
Setting themeColor will not affect selectionColor and rollOverColor. Setting themeColor affected the selectionColor and rollOver styles of the List-based components. Setting themeColor with for a component using a Spark skin won't do anything. Setting themeColor on a component using a halo skin will work to affect other styles. However, rollOverColor and selectionColor will not be affected. Anyone using themeColor on components that support selectionColor and rollOverColor (e.g. List components) svn revision 5152
Flex components use Spark theme as the default. Components used the Halo theme. Components used the Spark theme. The Spark theme supports a different set of styles than

the Halo theme. Styles that worked in the Halo theme will often not work in the Spark theme.

All applications that did not use a custom theme will be affected. However, the Halo theme

is still included in the Flex SDK.

svn revision 5092
Component dropdowns and Menus open immediately. Component dropdowns and Menus opened using a tween effect. Component dropdowns and Menus open immediately. This will affect anyone using a ComboBox, DateField, ColorPicker or a Menu-based component. svn revision 5092
Type selectors don't work w/o namespace specification Flex did not support multiple namespaces with css. Multiple namespaces are supported, therefore, for every type selector, you will need to specify the namespace. Applications using type selectors like:
   Button {color: #FF0000;}

will be affected. You will need to add '@namespace "library://ns.adobe.com/flex/halo";' to the top of your style block or css file.

svn revision 5573
Disabled Halo Containers get dimmed borders. The alpha value of the borders on disabled Halo containers was not reduced. The borders get lighter for disabled Halo containers. Application using disabled Halo containers. None
Binding expression '@{ref_value}' will now be recognized as a two-way binding expression The following binding expression:

<mx:String id="str"> test </mx:String> <mx:Text text="@{str}"/> will be interpreted as one-way binding with the Text component's text property getting the value 'test'.

The preceding binding expression will be interpreted as a two-way binding expression where a change in the string component will update the text property of the Text component, and any change in the text property of the Text component will update the string component. Applications built using Flex 3, where the expression '@{expr}' is used, will encounter this issue when the application is migrated to Flex 4. svn revision 3535
         

Approved Changes Not Supported By The Backwards Compatibility Flag

The following changes are not supported by the -compatibility-version flag. Therefore, you cannot revert any of the new behavior to an older version of Flex.


Brief Summary Behavior in 3.x Behavior in Gumbo When will a user encounter this issue? Reference
A NumericStepper is a pixel wider when you change it's fontFamily. N/A A NumericStepper is 1 pixel wider than in Flex 3. Applications using a NumericStepper with a fontFamily defined will be affected. svn revision 3189
Using filters tags in MXML now use Flex filters. When you used filters in MXML in Flex 3, the flash.filters package was used.

The flash filters have the array properties: colors, ratios and alphas.

In Flex 4, the same filter tags use Flex filters in the mx.filters package.

The flex GradientBevelFiter, GradientFilter and GradientGlowFilter have an array property called 'entries' which contain GradientEntry instances. GradientEntry has color, ratio, and alpha properties.

Applications that used tags for: BevelFilter, BlurFilter, ColorMatrixFilter, ConvolutionFilter, DisplacementMapFilter, DropShadowFilter, GlowFilter, GradientBevelFilter, GradientGlowFilter will be affected. svn revision 3573
HTML Templates now place swfs at the top and center of a page SWFs were positioned left-justified at the top of a page. SWFs are positioned center-justified at the top of a page. Anyone using HTML templates included with the Flex SDK. svn revision 3969
You can no longer bind 'name' in a State An application could bind to a const for compile-time including 'name'. The behavior was changed to support the new States model in Flex 4 where the name value behaves like 'id' and is used at compile time so it can't be something that gets set at runtime. Applicationstrying to bind 'name' in a State (e.g. <mx:State name='{someVar}' />) will get an error. None
'top' is now a reserved word In Flex 3, an Application could define a variable in an application with the name: 'top'. When trying to use a variable 'top', an application will now get a compiler error: 'Error: A conflict exists with inherited definition mx.core:UIComponent.top in namespace public mx.core:IVisualItem' when defining 'top'. Applications defining a variable in their application as 'top'. None
Alert Positioning of Buttons changed The alert layout code was positioning the buttons/text on

sub-pixel boundaries if the width or height of the alert was an odd number of pixels.

Flex 4 always snaps to pixel boundaries now. The difference is minor, but, the buttons in an Alert might be shifted a pixel over. svn revision 5170
Application.application has been deprecated Use Application.application to access your root document. Use FlexGlobals.topLevelApplication to access your root document. The FlexGlobals class is in the mx.core.* package Applications using Application.application will get a deprecation warning. svn revision 5331
Embed asset source starting with "/" behaves different Embed asset source starting with "/" works in FlexBuilder, but not in mxmlc Embed asset source starting with "/" works in mxmlc If an application had something like the following:

src/foo/bar.png src2/foo/bar.png Now the first one wins, even for components under the src2 directory.

4208, SDK-15466
We now throttle the framerate of inactive AIR applications   By default, we now throttle the framerate of inactive AIR applications for performance reasons.   7753
Marshall Plan / Versioning code is now opt-in Versioning Code was baked into the framework In Flex 4, you need to opt-in to receive the Versioning support. You do this by adding -includes=mx.managers.systemClasses.MarshallingSupport to your compiler arguments. Anyone loading 3.2 or greater swfs into SWFLoader or those loading cross-domain swfs into SWFLoader 8023
Script blocks need to be contiguous You could have Script blocks anywhere in your code Non-contiguous Script blocks will result in the compile error: "Child elements specifying default property value must be contiguous." Anyone using multiple Script blocks in their application file.
You must specify package names when using the StyleManager APIs getStyleDeclarations or setStyleDeclarations This was allowed:

StyleManager.getStyleDeclarations("TextInput")

This is the new syntax:

StyleManager.getStyleDeclarations("mx.controls.TextInput")

This will affect anyone using type selectors with the StyleManager APIs.
HTML Template changed to use the background color set in the Flex application The background color for the HTML template defaulted to white for all applications. The background color will be set to the backgroundColor property set in your Flex Application Anyone using the out of the box HTML templates will be affected 9707, SDK-22723
         
Retrieved from "http://labs.adobe.com/wiki/index.php/Flex_4:Backward_Compatibility"