Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting the bytes loaded

Status
Not open for further replies.

kav40

Vendor
Mar 3, 2004
24
LK
I want to load a movie in to another movie. In the host movie, I need to have a preloader.
How can I get the total bytes loaded using getByesloaded() command? I want to get the total bytes loaded including the host movie & the loading movie.
Please help.
 
If you're loading into an empty movie clip you'll need this syntax:

Code:
loadedPercent=myMovieClip.getBytesLoaded()/myMovieClip.getBytesTotal()

If you're loading the movie into a level you'll need something like this:

Code:
loadedPercent=_level1.getBytesLoaded()/_level1.getBytesTotal()
 
"I want to get the total bytes loaded including the host movie & the loading movie..."
 
My, what a helpful post Old...

If you need to combine the total loads on separate movies the same syntax applies - just add the 'getBytes' values for each movie together:

Code:
//main movie
movie1.bL = this.getBytesLoaded();
movie1.bT = this.getBytesTotal();
//movie loaded into a clip
movie2.bL = myMovieClip.getBytesLoaded();
movie2.bT = myMovieClip.getBytesTotal();
//
loadedPercent = Math.ceil((movie1.bL+movie2.bL)/(movie1.bT+movie2.bT)*100);




 
I reached my goal! Which was to have you complete your answer... And guess what? It worked! [tongue]
 
No correction! It hasn't work!
I understand kav40's question, as wanting his main movie's preloader displaying the total of both the main movie's bytes loaded and of the "to be loaded" movie's bytes...

And that you haven't really answered. [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top