User Guide
814 Loader component
If you load certain version 2 Macromedia Component Architecture 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 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 loadMovie(), add the following code:
myMovieClip._lockroot = true;
If you don’t 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.
Flash Player 7 supports the
_lockroot property. For information about this property, see
_lockroot (MovieClip._lockroot property) in ActionScript 2.0 Language Reference.
Components such as Loader, ScrollPane and Window have events to determine when content
has finished loading. So, if you want to set properties on the content of a Loader, ScrollPane,
or Window, add the property statement within a “complete” event handler, as shown in the
following example:
loadtest = new Object();
loadtest.complete = function(eventObject){
content_mc._rotation= 45;
}
my_loader.addEventListener("complete", loadtest)
For more information, see “Loader.complete” on page 823.
Loader parameters
You can set the following authoring parameters for each Loader component instance in the
Property inspector or in the Component inspector (Window > Component Inspector
menu option):
autoload indicates whether the content should load automatically (true), or wait to load
until the
Loader.load() method is called (false). The default value is true.
contentPath an absolute or relative URL indicating the file to load into the loader. A relative
path must be relative to the SWF file loading the content. The URL must be in the same
subdomain as the URL where the Flash content currently resides. For use in Flash Player or in
test mode, all SWF files must be stored in the same folder, and the filenames cannot include
folder or disk drive specifications. The default value is
undefined until the load starts.