534
ActionScript classes
You can use the
loadClip()
method to load one or more files into a single movie clip or level;
MovieClipLoader listener objects are passed to the loading target movie clip instance as a
parameter. Alternatively, you can create a different
MovieClipLoader
object for each file that
you load.
Use
MovieClipLoader.unloadClip()
to remove movies or images loaded with this method
or to cancel a load operation that is in progress.
MovieClipLoader.getProgress()
and
MovieClipLoaderListener.onLoadProgress
do
not report the actual
bytesLoaded
and
bytesTotal
values in the Authoring player when the
files are local. When you use the Bandwidth Profiler feature in the authoring environment,
MovieClipLoader.getProgress()
and
MovieClipLoaderListener.onLoadProgress
report the download at the actual download rate, not at the reduced bandwidth rate that the
Bandwidth Profiler provides.
Availability:
ActionScript 1.0; Flash Lite 2.0
Parameters
url
:
String
- The absolute or relative URL of the SWF or JPEG file to be loaded. A relative
path must be relative to the SWF file at level 0. Absolute URLs must include the protocol
reference, such as http:// or file:///. Filenames cannot include disk drive specifications.
target
:
Object
- The target path of a movie clip, or an integer specifying the level in Flash
Player into which the movie will be loaded. The target movie clip is replaced by the loaded
SWF file or image.
Returns
Boolean
- A Boolean value. The return value is
true
if the URL request was sent successfully;
otherwise the return value is
false
.
Example
The following example shows you how to use the
MovieClipLoader.loadClip
method by
creating handler for the
onLoadInit
event and then making the request.
The following code should either be placed directly into a frame action on a timeline, or
pasted into a class that extends MovieClip.
Create a handler method for the
onLoadInit
event.
public function onLoadInit(mc:MovieClip):Void {
trace("onLoadInit: " + mc);
}
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...