A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Preloader help!

  1. #1
    Member
    Join Date
    Dec 2006
    Posts
    43

    Preloader help!

    What've created, well had help with, is a preloader which loads the bytes.

    movieLoaded = this.getBytesLoaded();
    movieTotal = this.getBytesTotal();
    percentage = Math.floor(movieLoaded/movieTotal*100);
    display.text = "LOADED: "+percentage+" %";
    if (percentage >= 100) {
    gotoAndPlay("content", 1);
    }

    This works fine, but what I want to do is to have a loading bar along side the existing preloader.

    What would I need to add to the existing script to make it work?

    Cheers
    Last edited by =RIDDICK=; 02-28-2008 at 04:38 AM.

  2. #2
    Member
    Join Date
    Nov 2007
    Location
    Tampere, Finland
    Posts
    36
    preloader_mc.bar_mc._xscale = 0;
    preloader_mc.display.text = "LOADED: 0 %";
    this.onEnterFrame = function ()
    {
    movieLoaded = this.getBytesLoaded();
    movieTotal = this.getBytesTotal();
    percentage = Math.floor(movieLoaded/movieTotal*100);
    this.preloader_mc.display.text = "LOADED: "+percentage+" %";
    this.preloader_mc.bar_mc._xscale = percentage;
    if (percentage >= 100) {
    gotoAndPlay("content", 1);
    }
    }
    Why do it the Hard way, when you could do it the Impossible way

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center