Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flex Developer Center /

Introducing Adobe Flex 4.6 SDK

by Jacob Surber

Jacob Surber
  • Adobe

Content

  • New Spark mobile components in Flex 4.6
  • SDK enhancements in Flex 4.6
  • Where to go from here

Created

30 November 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
components Flex mobile Spark

The Flex 4.6 release builds on the mobile capabilities introduced in Flex 4.5, enabling you to:

  • Create tablet apps with multiple views and adaptive layouts.
  • Use new tablet focused UI components, including Callout, SpinnerList, and ToggleButton controls.
  • Add text inputs with OS-specific interfaces and interactions to your apps.
  • Leveraging these new capabilities, you can create tablet-optimized applications that target the latest devices, including the Apple iPad, the vast array of Google Android tablets, and the BlackBerry PlayBook.

This article introduces the new components and capabilities added to Flex 4.6 SDK.

New Spark mobile components in Flex 4.6

Flex 4.6 includes several new Spark mobile components.

SplitViewNavigator

The SplitViewNavigator is a new root level component that manages multiple ViewNavigator components. The ViewNavigator component, introduced in Flex 4.5, provides a stack-based mechanism to handle transitions, history, and memory management of Views. One of the most common uses of SplitViewNavigator is in the creation of a design pattern known as Master/Detail. Figure 1 shows an example of an application making use of the SplitViewNavigator. Queue Manager, an application built by Jonathan Campos of UnitedMindset and currently available on both iPad and Android tablets, shows how the Master/Detail design pattern can be used in tablet applications.

Figure 1. The Queue Manager app, illustrating the Master-Detail design pattern.
Figure 1. The Queue Manager app, illustrating the Master-Detail design pattern.

The left side of the application, or Master, is the View focused on navigation. The right side of the application, or Detail, displays the corresponding content. This powerful component can manage two or more ViewNavigator components at a time, and enables you to target and push views to any one of them.

Callout and CalloutButton

Callout is a component that you will find many use cases for on tablet devices. The component extends SkinnablePopUpContainer and inherits all of its functionality, but provides a relatively positioned arrow (see Figure 2).

Figure 2. A basic Callout.
Figure 2. A basic Callout.

This fully skinnable component can contain any kind of content, from a group of components to entire Views.

There is a tremendous amount of logic built into this simple looking component. While you have the option to explicitly choose the direction of the arrow and set the height, width, and position of the callout relative to its parent, all of these options can be automatically determined for you based on the component's contents and its parent's position on screen.

Extending Callout and adding functionality, CalloutButton provides similar capabilities to what you might see as dropdowns on tablet platforms today. Functionality like hiding and showing the Callout is wrapped into this straightforward class. Tapping the CalloutButton will display the Callout and its CalloutContents. Touching anywhere outside the Callout will fade it out and remove it. This behavior and appearance can all be modified by changing the CalloutSkin.

Using Callout and SplitViewNavigator together

One of the major conveniences of SplitViewNavigator is the ability to display the first navigator, most typically the Master view, in a Callout upon device reorientation (see Figure 3).

Figure 3. A CallOut in Queue Manager.
Figure 3. A CallOut in Queue Manager.

By simply setting autoHideFirstViewNavigator to true , the Master view is automatically hidden when the device is in portrait mode. If you define states for landscape and portrait and add a button to the Detail view's navigationContent that calls showFirstViewNavigatorInPopUp on click, your master view will be shown in a Callout. Below is a short example:

<s:SplitViewNavigator id="splitNavigator" autoHideFirstViewNavigator="true"> <s:ViewNavigator width="400" height="100%" firstView="views.MasterView" /> <s:ViewNavigator width="100%" height="100%" firstView="views.DetailView"> <s:navigationContent.portrait> <s:Button id="calloutButton" label="Navigation" click="splitNavigator.showFirstViewNavigatorInPopUp(calloutButton)" /> </s:navigationContent.portrait> </s:ViewNavigator> </s:SplitViewNavigator>

SpinnerList

The SpinnerList component is an entirely new take on List (see Figure 4), and it is optimized for mobile interactions.

Figure 4. The SpinnerList component.
Figure 4. The SpinnerList component.

The first thing you will notice is an updated visual appearance and a change in how selection is managed. Unlike the Spark List, SpinnerList manages selection based on position. SpinnerList also offers a unique Boolean property, wrapElements . When set to true (the default), the SpinnerList will wrap the elements in the list around the spinner in an uninterrupted loop. SpinnerList comes with a companion component called SpinnerListContainer. The SpinnerListContainer component not only holds single or multiple SpinnerList components, but its skin also provides the border, gradient appearance, and selection bar.

DateSpinner

The DateSpinner control extends SpinnerList and uses SpinnerListContainer to provide an extremely useful and versatile date component (see Figure 5). DateSpinner offer three modes of displaying information:

  • DateSelectorDisplayMode.DATE
  • DateSelectorDisplayMode.TIME
  • DateSelectorDisplayMode.DATE_AND_TIME
Figure 5. The DateSpinner control.
Figure 5. The DateSpinner control.

These modes can not only be used to display current date and time information, but also provide an intuitive method of selecting dates and times. DateSpinner is also fully localizable. By simply changing the locale property on the component, the display language be changed, along with the format in which the date is displayed.

ToggleButton

On the surface, the straightforward ToggleButton component enables users to slide a switch from left to right to make a simple choice. Under the hood, the Flex Spark skinning architecture lets you customize this control to display customizable text, display images, or even change its behavior.

SDK enhancements in Flex 4.6

Complementing the new user interface components, Flex 4.6 has several SDK enhancements.

StageText

You may have used the <InputText> and <TextArea> components in previous Flex mobile applications. When compiled with Flex 4.6, these components will now leverage StageText. StageText is a joint effort between the AIR and Flex teams to enable text editing in your application to use the device's native text editing controls. This means your user will see the usual editing UI and have the expected experience no matter what OS version or platform your application is running on. StageText provides this native editing experience by punching through to the OS and exposing these controls. As a result, these text fields do not reside on the display list. 

Dynamic splash screens

With the ever-growing number of devices and form factors, the implementation of SplashScreen in Flex 4.5 was simply not going to scale. We went back to the drawing board and created SplashScreenImage. SplashScreenImage was specifically designed to let you specify different splash screens based on the device and orientation. To create this new dynamic splash screen, create a new MXML file based on SplashScreenImage, and then add multiple instances of SplashScreenImageSource that define what asset to display based on DPI or screen resolution. For example:

<s:SplashScreenImage xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <!-- 160dpi phone --> <s:SplashScreenImageSource dpi="160" source="@Embed('assets/image-phone.png')" /> <!-- 240 & 320 dpi phone share the same image --> <s:SplashScreenImageSource dpi="240" source="@Embed('assets/image-phone960.png')" /> <s:SplashScreenImageSource dpi="320" source="@Embed('assets/image-phone960.png')" /> <!-- Tablets all share the same image --> <s:SplashScreenImageSource minResolution="960" source="@Embed('assets/image-tablet.png')" /> </s:SplashScreenImage>

After your SplashScreenImage has been created, simply assign the class instance to the splashScreenImage property in your main application tag. Upon launching your app on a device, the splash screen will display with the correct image size and DPI; it will even auto-rotate to show the correct image based on the orientation of your device.

Scroller

Several under-the-hood enhancements have been made to Scroller. First and foremost, scroll bars are now created on demand. This means your application does not spend time up-front creating scrollbars for content until the content is scrolled, resulting in a view creation performance boost.

Two new properties have also been added: pageScrollingEnabled and scrollSnappingMode . When pageScrollingEnabled is set to true the scroller will advance by the size of the current viewport. Additional conveniences are built in such that if the scroll velocity is not high enough or you do not scroll the content at least 50% of the way, the content will snap back to its original location. The scrollSnappingMode property lets you further tune your scrolling interaction by allowing you to control the ending scroll position. With options like leadingEdge , trailingEdge , and center , you can make sure your list lands in the appropriate place after a throw.

16-bit and 32-bit render modes

When creating a new mobile project with Flex 4.6, a new Android-specific flag has been created in app.xml named <colorDepth> . By default when Flash Builder creates a new Flex mobile project, it sets this value to "16bit" . You have the option to change this value to "32bit" . There are pros and cons to both options. The 16-bit mode is optimized for performance and other general use cases. The 32-bit mode offers specific features that your app may require, such as StageVideo, Stage3D support, and superior rendering of gradients. Make sure to evaluate the requirements of your entire app before making the switch to 32-bit rendering on Android.

Where to go from here

This article provided an overview of some of the new capabilities in Flex 4.6 SDK. For more information please refer to the Flex SDK documentation. To learn more about Adobe's mobile development tooling see Adam Lehman's article What's new in Flash Builder 4.6.


This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License.

More Like This

  • Building interactive maps with Flex
  • Creating components and enforcing separation of concerns with Flex
  • Creating Flex components
  • Flex mobile development tips and tricks – Part 1: Data handling
  • Finicky: A custom-skinned mobile Flex application
  • Flex mobile development tips and tricks—Part 4: Creating an alert popup and other skinnable popups
  • Flex mobile performance checklist
  • Flex mobile development tips and tricks – Part 5: Using mobile view and tab transitions
  • Flex mobile development tips and tricks – Part 2: Styling your application's tabs and ActionBar
  • Caltrain Times from design to release: A story of mobile application development

Tutorials & Samples

Tutorials

  • Flex mobile performance checklist
  • Flex and Maven with Flexmojos – Part 3: Journeyman
  • Migrating Flex 3 applications to Flex 4.5 – Part 4

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Flex User Forum

More
07/25/2011 Flash Player Debug Issues - Safari 5.1 & Chrome 13
04/22/2012 Loader png - wrong color values in BitmapData
04/22/2012 HTTPService and crossdomain.xml doesn't work as expected
04/23/2012 Memory related crashes in Flex application

Flex Cookbook

More
04/06/2012 How to detect screen resize with a SkinnableComponent
02/29/2012 Embed Stage3D content inside Flex application components
02/15/2012 Custom WorkFlow Component
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement