ActionScript 3 continues the object-oriented metaphors that appeared in
ActionScript 2, but it starts fresh in a new file type (the ActionScript 3
FLA) using a totally standardized approach to coding. Components are built in
ways similar to those built before, but the general syntax of creating classes
has been extended to include a package syntax for clearer naming and now also
includes a common approach for handling events.
This section of the article overviews the primary components included in the Flash
video gallery application and their editable features in the FLA and
ActionScript source files.
Tip: A class is a definition for an object in ActionScript. It's similar to a symbol in that it defines the object.
For an overview of ActionScript 3, please see the getting-started resources in the ActionScript Technology Center. To learn how to use the new user interface and video ActionScript 3 components, read the Flash and ActionScript components learning guide.
To better understand how components are created and implemented, you'll explore elements of the thumbnail and detail view controls in the gallery application. These controls compose the majority of the application's functionality.
The Thumb component (VideoThumbnail class) is basically a specialized button. Thumb component instances are positioned in a grid located on the upper left of the application as selectable previews. As the user rolls over one of the Thumb components, the preview for the video jumps into focus and plays in a loop. There is also a Tooltip component (Tooltip class) that floats on top of each Thumb component to display the thumbnail's title as Tooltip text (see Figure 8).

Figure 8. Preview and selection area of the application composed of a grid of thumb controls in the user interface
The ActionScript logic that powers the Thumb component lives in the VideoThumbnail.as class inside the fvg package. Start by taking a look at the ActionScript file.
To open the Thumbnail component ActionScript file:
Notice that the script contains the logic to:
The VideoThumbnail class is associated with the corresponding graphic assets using the symbol properties of a movie clip in the FLA file. This step adds a physical presence to the script in the movie. It gives you a way to place the Thumb component and interact with it during authoring—even if the component is generated dynamically via script at run time. Take a look at the Thumb movie clip symbol for the Thumbnail component (see Figure 9).

Figure 9. Timeline and Stage for the Thumb movie clip symbol
To open the Thumb control movie clip:
The ActionScript 3 class and the movie clip symbol are what define the Thumbnail component both physically and functionally. However, if you look through the layers of the Application timeline in FlashVideoGallery.fla, you notice that the thumbnail grid does not exist during authoring. The Application instance uses the ActionScript associated with it (FlashVideoGallery.as) to load the XML data and build the grid of thumbnails dynamically based on the data source. Take a look at the code in the FlashVideoGallery class to see the initialization routine.
To open the FlashVideoGallery.as ActionScript file:
layout function. At this point, the
XML has been loaded and the class can build the layout based on the user-defined
settings.Notice that the initialization code does the following:
setData on each thumbnail instance and sets the unique data for that thumbnail as
supplied by the XML fileThe DetailView component sits on the right side of the application and displays the full video clip and its related site information. When a user selects a Thumbnail component, the DetailView component displays a new view on the right side of the screen (see Figure 10). Notice the addition of the ActionScript 3 FLVPlayback and custom UI components.

Figure 10. Editable layout of the detail view movie clip
The DetailView component contains similar pieces to the Thumb component. Take a look, starting with the ActionScript 3 class.
To open the DetailView component ActionScript file:
setData function.Notice that the script contains the logic to do the following:
Here again the ActionScript 3 class is tied to the FLA file through a movie clip's symbol properties.
To open the DetailView movie clip:
The FlashVideoGallery.fla file initializes the DetailView component dynamically just before the thumbnails are loaded. Functions in the FlashVideoGallery.as class control the initialization of data into the instance as thumbnails are clicked. Explore the code to see how this all ties together.
To open the FlashVideoGallery.as ActionScript file:
showDetail function. As you would
expect, this function shows and hides the detail view as needed. The
function is called when the user clicks and
releases their mouse button on a Thumb component.The two remaining custom-built components are the TextLink and Tooltip controls. The TextLink control is basically a button that appears as a text link with a rollover highlight. The Tooltip control appears when the cursor is above a Thumb control.
These controls and associated classes are brief in comparison to the others. Take a look by exploring the assets as you did with the other controls.
This version of the video gallery uses a standard approach to handling UI components and video components. Besides ease of development, the ActionScript 3 components allow you to fully customize the video gallery—making it easier to design your own controls and add your own branding.