Loading external SWF and image files
595
Register the listener object with the MovieClipLoader object
In order for the listener
object to receive the loading events, you must register it with the MovieClipLoader object, as
shown in the following code:
my_mcl.addListener(mclListener);
Begin loading the file (image or SWF) into a target clip
To start downloading an image or
SWF file, you use the
MovieClipLoader.loadClip()
method, as shown in the following
code:
my_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
img_mc);
The following example uses the
setProgress()
method of the ProgressBar component to
display the downloading progress of a SWF file. (See “ProgressBar.setProgress()” in
Components Language Reference
.)
To display downloading progress by using the ProgressBar component:
1.
Create a new Flash document, and save it as
progress.fla
.
2.
Open the Components panel (Window > Components).
3.
Drag a ProgressBar component from the Components panel to the Stage.
4.
In the Property inspector (Window > Properties > Properties), name the ProgressBar
component
my_pb
.
5.
Select Frame 1 in the Timeline, and open the Actions panel (Window > Actions).
NO
TE
You can use MovieClipLoader methods only to track the downloading progress of files
loaded with the
MovieClipLoader.loadClip()
method. You cannot use the
loadMovie()
function or
MovieClip.loadMovie()
method.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...