We Recommend

Learning Perl Learning Perl
In this smooth, carefully paced course, a leading Perl trainer teaches you to program in the language that threatens to make C, sed, awk, and the Unix shell obsolete for many tasks. This book is the "official" guide for both formal (classroom) and informal learning. It is fully accessible to the novice programmer.


Posted By

marc0047 on 07/08/06


Tagged

time check actionscrip setInterval preload movie size


Versions (?)


Who likes this?

8 people have marked this snippet as a favorite

saveasraw
jkochis
damarev
bicherele
horizens
visualAesthetic
andrewrench
digitalifer


Preload and check movie size with setInterval


Published in: ActionScript 


  1. _global.queryload = function(clip, intervalname) {
  2. clip.bytes_loaded = Math.round(clip.getBytesLoaded());
  3. clip.bytes_total = Math.round(clip.getBytesTotal());
  4. trace(clip.bytes_loaded + " / " + clip.bytes_total);
  5. if ( clip.bytes_loaded == clip.bytes_total ) {
  6. trace("done");
  7. trace(_root[intervalname]);
  8. clearInterval(_root[intervalname]);
  9. }
  10. }
  11.  
  12. // To check internally, call it this way:
  13. // preloader = setInterval(queryload, 500, this, "preloader");
  14.  
  15. // To check externally, call it this way:
  16. // container.loadMovie("catnap.jpg");
  17. // preloader = setInterval(queryload, 500, container, "preloader");

Report this snippet 

You need to login to post a comment.