Table of Contents

MovieClip.getBytesTotal( ) Method Flash 5

check the size of a clip or movie, in bytes
mc.getBytesTotal()

Returns

An integer representing the uncompressed size of mc, in bytes. Divide by 1024 to convert bytes to kilobytes (KB).

Description

The getBytesTotal( ) method tells us the uncompressed size, in bytes, of a clip instance or the main movie. When invoked on the main movie, getBytesTotal( ) reports the size of the entire .swf file. It is normally used in concert with getBytesLoaded( ) to create preloaders for main movies and .swf or .jpg files loaded into instances or levels via loadMovie( ).

The loadMovie( ) and unloadMovie( ) functions are executed asynchronously. Hence, the return value of getBytesTotal( ) varies according to when it is called and the value of mc, as follows:

Usage

As with getBytesLoaded( ), in Flash 6 the return of getBytesTotal( ) reflects the uncompressed size of the .swf file being loaded, not the size of the file after Flash compression has been applied. This means that getBytesTotal( ) for a .swf file with a post-compression size of 2,000 bytes might return, say, 10,000 bytes. As such, it cannot be used to predict the time left in the download of a compressed .swf file. It is intended to offer only a relative measure of the percentage of the file that is downloaded, in concert with getBytesLoaded( ).

See Also

loadMovie( ), MovieClip._framesloaded, MovieClip.getBytesLoaded( ), MovieClip.loadMovie( ), MovieClip._totalframes, MovieClip.unloadMovie( ), unloadMovie( )


Table of Contents