
MovieClip.onDragOut() Event Handler
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
678
|
ActionScript Language Reference
// Turn on data-transfer light (indicator)
_root.transferIndicator.gotoAndStop("on");
// If we're done loading, turn off data-transfer light, and let the movie play
if (getBytesTotal() > 0 && getBytesLoaded() = = getBytesTotal()) {
_root.transferIndicator.gotoAndStop("off");
play();
}
// Display some loading details in text field variables on the _root
_root.bytesLoaded = getBytesLoaded();
_root.bytesTotal = getBytesTotal();
_
root.clipURL = _url.substring(_url.lastIndexOf("/") + 1, _url.length);
}
This example also provides feedback while the movie is loading. Note that the .swf file
being loaded should have a stop() function call on its first frame to prevent it from auto-
matically playing before it is completely downloaded. A variation of this example is
available at the online Code Depot.
Bugs
In Flash 5 on a high-speed connection, the onData() event does not always execute when a
.swf file completely loads. This unofficial bug has not been verified by Macromedia, but it
appears to be fixed in the release 29 of Flash Player 6 (6.0.29.0).
See Also
loadMovie(), loadVariables(), the LoadVars class, MovieClip.getBytesLoaded(), MovieClip.
getBytesTotal(),
MovieClip._framesloaded, MovieClip._framestotal, MovieClip.onLoad( ...