
MovieClip.getBytesLoaded() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
658
|
ActionScript Language Reference
See Also
MovieClip.globalToLocal(), MovieClip.hitTest(), MovieClip.localToGlobal
MovieClip.getBytesLoaded() Method
check the number of bytes that have downloaded to the Player
Flash 5
mc.getBytesLoaded()
Returns
An integer representing the number of bytes of mc that have finished downloading to the
Player. Divide by 1024 to convert bytes to kilobytes (KB).
Description
The getBytesLoaded() method tells us the number of bytes of a movie or JPEG image that
have downloaded into the Flash Player. However, data usually arrives in chunks of several
hundred or several thousand bytes, and getBytesLoaded() measures bytes in terms of these
chunks only. So, if a movie’s first frame is 200 bytes in size and its second frame is 3000
bytes in size, getBytesLoaded() may return 200 and 3200, but it will never return any incre-
ment in between.
Note that internal movie clips are always loaded entirely before they are displayed, so the
return value of getBytesLoaded() on an internal movie clip is always the same as
getBytesTotal(), unless the movie clip is currently loading an external file in response to
loadMovie(). Therefore, getBytesLoaded() is generally useful only when used with an
external .swf or .jpg file being loaded into an instance ...