Loader component
The Loader component is a container that can display a SWF or JPEG file. You can scale the
contents of the loader or resize the loader itself to accommodate the size of the contents. By
default, the contents are scaled to fit the loader. You can also load content at runtime and monitor
loading progress.
A Loader component can't receive focus. However, content loaded into the Loader component
can accept focus and have its own focus interactions. For more information about controlling
focus, see
"Creating custom focus navigation" on page 50
A live preview of each Loader instance reflects changes made to parameters in the Property
inspector or Component inspector during authoring.
You can use the Accessibility panel to make Loader component content accessible to screen
readers. For more information, see Chapter 17, "Creating Accessible Content," in Using Flash.
Using the Loader component
You can use a loader whenever you need to retrieve content from a remote location and pull it
into a Flash application. For example, you could use a loader to add a company logo (JPEG file)
to a form. You could also use a loader to leverage Flash work that has already been completed. For
example, if you had already built a Flash application and wanted to expand it, you could use the
loader to pull the old application into a new application, perhaps as a section of a tab interface. In
another example, you could use the loader component in an application that displays photos. Use
Loader.load()
image loads and display progress bars to the user during loading.
If you load certain 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
If you're using the Loader component, add the following code:
myLoaderComponent.content._lockroot = true;
If you're using a movie clip with a call to
myMovieClip._lockroot = true;
If you don't set
_lockroot
library, but not the library in the loaded movie clip.
The
_lockroot
MovieClip._lockroot
Loader parameters
You can set the following authoring parameters for each Loader component instance in the
Property inspector or in the Component inspector:
autoload
indicates whether the content should load automatically (
the
Loader.load()
484
Chapter 6: Components Dictionary
,
Loader.percentLoaded
property when calling
to
in the loader movie clip, the loader only has access to its own
true
property is supported by Flash Player 7. For information about this property, see
in Flash ActionScript Language Reference.
method is called (
or
, and
Loader.complete
or loading into the Loader component.
loadMovie()
, add the following code:
loadMovie()
). The default value is
false
CHAPTER 6
Components Dictionary
"FocusManager class" on page
to control the timing of the
), or wait to load until
true
.
true
419.
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?