Accessibility
Hans Muller

Hans Muller

hansmuller-flex.blogspot.com

Table of Contents

Created:
2 November 2009
User Level:
Intermediate
Products:
Flex

Introduction to viewports and scrolling in Flex 4 beta

Flex 4 beta provides an interface called IViewport that all scrollable components must implement, and Scroller, a component that uses scrollbars to enable interactive scrolling of a viewport (a component that implements IViewport). This support for interactive scrolling is an essential feature of all graphical user interface (GUI) toolkits. The Flex 4 beta approach is intended to be more efficient than the one used in Flex 3; see the section Comparison with MX scrolling for more details.

Many Flex components, including List and TextArea, include a Scroller and a viewport as part of their skin, so that developers don’t have to worry about enabling scrolling. This article explains how the IViewport interface works and includes a simple Scroller example. If you’re interested in creating your own interactive scrolling components or just want a better understanding of how Flex 4 scrolling works, read on.

Requirements

In order to make the most of this article, you need the following software and files:

Flex 4 beta

Flash Builder 4 beta

Sample files:

Prerequisite knowledge

Familiarity with ActionScript, Flex3, and basic 2D graphics concepts will be helpful in understanding the concepts discussed in this article.

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

About the author

Hans Muller is a member of the Flex engineering team. Before coming to Adobe in early 2008, he was at Sun Microsystems where he worked on programming languages, distributed computing, and desktop and mobile GUI toolkits.