EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 595

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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).
NOTE
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.

Table of Contents

Related product manuals