Preloader Anim

Out of context: Reply #3

  • Started
  • Last post
  • 9 Responses
  • ganon0

    //put this in the first frame of your main timeline
    //label this frame "preloader", and another frame where the animation starts "main"
    //make your red bar a movie clip, with an instance name of "loader" with the animation tween of the bar lasting 100 frames
    //also if you want, include dynamic text boxes with the variables "totalbytes", "loadedbytes", "frame" etc to show the progress
    stop();
    this.totalbytes = this.getBytesTotal();
    this.totalkbytes = Math.ceil(this.totalbytes/1024);
    this.onEnterFrame = function() {
    this.loadedbytes = this.getBytesLoaded();
    this.loadedkbytes = Math.ceil(this.loadedbytes/1024...
    this.frame = int(this.loadedbytes/(this.total...
    tellTarget (this.loader) {
    gotoAndStop(this.frame);
    }
    if (this.loadedbytes == this.totalbytes) {
    this.gotoAndStop("main");
    delete (this.onEnterFrame);
    }
    };

    enjoy....

View thread