User Guide

62 Working with Components
About loading components
If you load version 2 components into a SWF file or into the Loader component, the
components may not work correctly. These components include the following: Alert,
ComboBox, DateField, Menu, MenuBar, and Window.
Use the
_lockroot property when calling loadMovie() or loading into the Loader
component. If youre using the Loader component, add the following code:
myLoaderComponent.content._lockroot = true;
If youre using a movie clip with a call to loadMovie(), add the following code:
myMovieClip._lockroot = true;
If you dont set _lockroot to true in the loader movie clip, the loader only has access to its
own library, but not the library in the loaded movie clip.
The
_lockroot property is supported by Flash Player 7. For information about this property,
see _lockroot (MovieClip._lockroot property) in the ActionScript 2.0 Language Reference.
Upgrading version 1 components to
version 2 architecture
The version 2 components were written to comply with several web standards (regarding
events [www.w3.org/TR/DOM-Level-3-Events/events.html], styles, getter/setter policies, and
so on) and are very different from their version 1 counterparts that were released with
Macromedia Flash MX and in the DRKs that were released before Macromedia Flash MX
2004. Version 2 components have different APIs and were written in ActionScript 2.0.
Therefore, using version 1 and version 2 components together in an application can cause
unpredictable behavior. For information about upgrading version 1 components to use
version 2 event handling, styles, and getter/setter access to the properties instead of methods,
see Chapter 6, “Creating Components,” on page 125.
Flash applications that contain version 1 components work properly in Flash Player 6 and
Flash Player 7, when published for Flash Player 6 or Flash Player 6 (6.0.65.0). If you want to
update your applications to work when published for Flash Player 7, you must convert your
code to use strict data typing. For more information, see “Writing custom class files” in
Learning ActionScript 2.0 in Flash.