Developer Network Home  Help 

YDN Flash Developer Center Astra Flash Components Form
Flash Developer Center

ASTRA Form

Form is a UI component used for the layout and alignment of form elements. Like the Flex Form Class, it contains multiple vertically positioned component items with label arrangement determined by width. Additionally, it supports data collection and validation implemented in a corresponding validation and data manager class.

Getting Started: Form for Flash CS3

Initializing a Form with ActionScript

To add a Form to your application with ActionScript, you must first include the Form component in your library. To do this, simply drag it from the Components panel directly to the library, or drag an instance to the stage and immediately delete it (the component will stay in your library). You must also import the following class in your class or frame script:

The Form class generates the form and the FormDataManager class collects data and validates it. There are several ways to create a form using the Form class. In this implementation, will create an array of DisplayObjects to be used as elements in the form and set it as the dataSource of the Form class instance.

Like any other Flash display object, you must add a Form to the display list by passing it to the addChild method on the intended parent. The following example instantiates a Form, populates it with pre-initialized TextInput components and adds it to the display list of its parent.

Screen capture of From

To see a live example, please install Adobe Flash Player version 9 or higher and ensure that JavaScript is enabled.

For additional topics, please read Using Form, or take a look at the Examples section for functional demonstrations. The ActionScript 3.0 Class Reference contains full details on every property, method, and style available to the Form component.