1.3 Flash MX 2004 Version 2 Components

 <  Day Day Up  >  

1.3 Flash MX 2004 Version 2 Components

Flash MX introduced components ” ready-to-use interface widgets and code modules that implement commonly needed functionality. Flash's built-in components make it relatively easy to create desktop-style Flash applications. Flash MX 2004 introduces the new v2 components , rewritten from scratch in ActionScript 2.0 and built atop version 2 of the Macromedia Component Architecture, which provides a much richer feature set than its predecessor. The new architecture necessitates new ways of developing and using components (see Chapter 12 for component usage). Officially, the v2 components require Flash Player 6.0.79.0 or higher; however, tests show that many v2 components work in earlier releases of Flash Player 6 ( especially Flash Player 6.0.40.0 and higher). If you want to use a v2 component in a version prior to Flash Player 6.0.79.0, you should test your application extensively.

A single application produced in either Flash MX 2004 or Flash MX Professional 2004 can include both v2 components and Flash MX's v1 components, provided the v1 components have been updated to support ActionScript 2.0 and the movie is exported in ActionScript 2.0 format.

Don't confuse v1 and v2 components with the version of ActionScript in which they are written. Granted, v2 components are written in ActionScript 2.0 and there are no ActionScript 1.0 versions of the v2 components. However, although v1 components were written originally in ActionScript 1.0, versions updated to compile under ActionScript 2.0 are available.

The v1 component update for ActionScript 2.0 is available at the Flash Exchange (http://www.macromedia.com/exchange/flash), in the User Interface category, under the title "Flash MX Components for Flash MX 2004."


If nonupdated v1 components (i.e., those written in ActionScript 1.0) are used with v2 components in the same movie, some compile-time and runtime errors may occur, depending on the components used.

Do not mix ActionScript 1.0 OOP techniques with ActionScript 2.0 code. If you are using classes, inheritance, and other OOP features, make sure all your code is upgraded to ActionScript 2.0.


Key new v2 component features include:

  • A new listener event model for handling component events, which lets many external objects receive a single component's events

  • CSS-based stylesheet support, making it easier to change text attributes across components

  • Focus management to support tabbing between user interface elements

  • Depth management to manage the visual stacking of components on screen

  • Richer accessibility support (i.e., better support for screen readers)

  • Richer skinning (i.e., graphic replacement) support

  • Encapsulation of component assets in a single file, allowing easier component management and sharing

The v2 components tend to be larger than their v1 counterparts. This is especially true if using only one or two components, as the v2 architecture is optimized for applications that use at least three or four different component types. Therefore, if you need only one or two components, and you don't need focus management or accessibility support, you'll get faster (smaller) downloads using the v1 components.

Beware that the default theme ("halo") for the v2 components does not support custom colors for scrollbars and buttons . That is, the scrollTrackColor and buttonColor style properties do not work with the default v2 component theme in Flash MX 2004 and Flash MX Professional 2004. To set the color of buttons and scrollbars on v2 components, you must apply a new theme to the document. See Help Using Components About Themes Applying a Theme to a Document.

Table 1-1 shows the complete set of components in Flash MX 2004 and Flash MX Professional 2004. Professional components that are not available in Flash MX 2004 will still work in that version of the software. That is, a .fla document that contains a component specific to the Professional edition will open normally and work properly in Flash MX 2004. Macromedia's End User License Agreement for Flash MX 2004 does not explicitly prohibit the use of Professional-only components in the standard edition of the software.

Table 1-1. The v1 and v2 components

Component

Flash MX

Flash MX 2004

Flash Pro

Notes

Accordion

[1]

 

v2

 

Alert

[2] , [3]

 

v2

 

Button

v1

v2

v2

 

CheckBox

v1

v2

v2

 

ComboBox

v1

v2

v2

 

Data Components

   

v2

Includes DataHolder, DataSet, RDBMSResolver, WebServiceConnector, XMLConnector, and XUpdateResolver

DataGrid

[2]

 

v2

 

DateChooser

[3] , [4]

 

v2

 

DateField

   

v2

 

Label

[1]

v2

v2

 

List

v1

v2

v2

 

Loader

[2]

v2

v2

 

Media Components

[2]

 

v2

MediaController, MediaDisplay, MediaPlayback

Menu

[3]

 

v2

 

MenuBar

   

v2

 

NumericStepper

 

v2

v2

 

ProgressBar

Footnote 2, [3]

v2

v2

 

RadioButton

v1

v2

v2

 

ScrollPane

v1

v2

v2

 

TextArea

v1

v2

v2

 

TextInput

v1

v2

v2

 

Tree

[3]

 

v2

 

Window

[3]

v2

v2

 

[1] Similar component available in DRK3 (http://www.macromedia.com/software/drk/productinfo/product_overview/volume3).

[2] Similar component available in DRK1 (http://www.macromedia.com/software/drk/productinfo/product_overview/volume1).

[3] Similar component available in Flash UI Component Set 2 at the Flash Exchange (http://www.macromedia.com/exchange/flash).

[4] Similar component available in DRK2 (http://www.macromedia.com/software/drk/productinfo/product_overview/volume2).

In Chapter 12, we'll learn how to program graphical, OOP applications that use the v2 components.

 <  Day Day Up  >  


Essential ActionScript 2.0
Essential ActionScript 2.0
ISBN: 0596006527
EAN: 2147483647
Year: 2004
Pages: 177
Authors: Colin Moock

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net