Archive for April, 2010

Accelerating Flex 3 development using Flash Builder 4

I was talking to a few developers this week and they were telling me that they were really psyched about Flash Builder 4 but were waiting to upgrade. When I asked why, they explained that they were in the middle of Flex 3 projects and didn’t want to transition to the new Flex 4 SDK until they completed the project. I realized that in all of our excitement about Flex 4 and the new Spark component model, that we neglected to let everyone know that 80% of the new features in Flash Builder 4 can help you immediately with your Flex 3 application development. Andrew Shorten just posted a great new article in the Flex Developer Center explaining how to set up Flash Builder 4 so you can continue working on your Flex 3 projects with no disruption while taking advantage of the great new features. This article is a one-stop-shop to learn all things about migration, including both tool and SDK. James Ward also posted a short video where you can see Flash Builder 4 in action working on a Flex 3 project.

Dave Gruber
Flash Builder and Flex Product Marketing Manager

Mirroring Layouts in Flex

Now that Flex 4 is out the door, don’t be fooled into thinking the Flex SDK team is resting on their laurels! We are planning a followup release to Flex 4 which should come out in the first half of 2010. This release will include support for Flash Player 10.1 and AIR 2 as well as contain some new feature work and critical bugfixes.

The feature I’m most excited about is the new “layout mirroring” feature. This feature allows developers to mirror their layouts for right-to-left locales. The intent of this feature is to trivialize repurposing a Flex UI designed for a left-to-right language (like English or French) for a right-to-left language (like Hebrew or Arabic).

To support layout mirroring, some new APIs have been added. The two most important are layoutDirection (defined by the new interface mx.core.ILayoutDirectionElement) that is settable on any UIComponent, GraphicElement, SpriteVisualElement or UIMovieClip. [Note: on UIComponent, layoutDirection is a style and for GraphicElement, SpriteVisualElement and UIMovieClip, layoutDirection is implemented as a property].

The new layoutDirection property can be set to “ltr”, “rtl”, or null. When set to “rtl”, a mirroring transform is applied to mirror the layout. This mirroring transform is implemented atop the advanced layout features that was introduced in Flex 4.

What about text? First off, applications that depend on layout mirroring need to use FTE text which supports bi-directionality. If you have a Spark based application or component, FTE is used by default. If you intend to mirror a Flex 3 application, you need to enable FTE text in order to have bi-directional text. Once the text in your application is FTE-based, all you need to do is turn “on” bi-directionality by setting direction=”rtl” on the text components (this style inherits, so you can simply set it at the top-level and it will percolate down). This will ensure the default embedding level of all text blocks in your application is right-to-left.

There are definitely some parts of your application you will want to hand-tweak as the UI gets mirrored. However, in order to get your feet wet, I’d suggest taking the application you want to mirror and setting layoutDirection=”rtl” and direction=”rtl” on the top-level container of your application. This will percolate down through the display list and mirror according to the default Flex implementation.

So, what does this all mean? Well, on Tuesday, 3/31/10 the layout mirroring feature signed off! This is a huge accomplishment for the SDK Dev and QA teams as this feature required a lot of coordination across multiple engineers on the team (as well as input from our globalization teams and external customers). I encourage people to use the multi-SDK feature in Flash Builder 4 to download a build containing the newly landed layout mirroring feature, and give it a try. The best build to download would be 4.1.0.15132 or any build posted after that changelist. To learn more about the layout mirroring feature, please read the specification and if you find issues, file them in JIRA.