MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 200

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

To display download progress using the ProgressBar component:
In a new Flash document, create a movie clip on the Stage and name it
1
Open the Components panel (Window > Development Panels > Components).
2
Drag a ProgressBar component from the Components panel to the Stage.
3
In the Property inspector, give the ProgressBar component the name
4
Parameters tab, select Manual from the Mode pop-up menu.
Select Frame 1 in the Timeline and then open the Actions panel (Window > Development
5
Panels > Actions).
Add the following code to the Actions panel:
6
// create both a MovieClipLoader object and a listener object
myLoader = new MovieClipLoader();
myListener = new Object();
// add the MovieClipLoader callbacks to your listener object
myListener.onLoadStart = function(clip) {
// this event is triggered once, when the load starts
pBar.label = "Now loading: " + clip;
};
myListener.onLoadProgress = function(clip, bytesLoaded, bytesTotal) {
var percentLoaded = int (100*(bytesLoaded/bytesTotal));
pBar.setProgress(bytesLoaded, bytesTotal);
};myLoader.addListener(myListener);
myLoader.loadClip("veryLargeFile.swf", target_mc);
Test the document by selecting Control > Test Movie.
7
For more information, see the
Dictionary," on page
200
Chapter 11: Working with External Media
MovieClipLoader class
205.
target_mc
pBar
entry in
Chapter 12, "ActionScript
.
and, on the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents