Posted By


pfeisinger on 04/09/09

Tagged


Statistics


Viewed 766 times
Favorited by 0 user(s)

Standardloader Flash 8 AS 2.0


/ Published in: ActionScript
Save to your folder(s)

Just shows the percentage of loaded file in a textfield and fades out the preloader, when loading complete.


Copy this code and paste it in your HTML
  1. stop();
  2. import caurina.transitions.*;
  3. _root.onEnterFrame = function()
  4. {
  5. trace("onEnterFrame");
  6. a = getBytesTotal();
  7. b = getBytesLoaded();
  8. percent = Math.round(b / a * 100);
  9. preloader_mc.status_tf.text = "Loading " + percent + "%";
  10. if (b >= a)
  11. {
  12. Tweener.addTween(preloader_mc, {_alpha:0, time:1, transition:"easeOutQuint", onComplete: onStartVideo});
  13. delete this.onEnterFrame;
  14. }
  15. };
  16.  
  17. function onStartVideo()
  18. {
  19. trace("onStartVideo()");
  20. preloader_mc._visible = false;
  21. gotoAndPlay(1);
  22. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.