A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How can create a preloader that shows the %?

  1. #1
    Junior Member
    Join Date
    Apr 2004
    Location
    Kingsport, TN
    Posts
    13

    How can create a preloader that shows the %?

    I'm trying to learn how to create a preloader that shows you how much % it has loaded so far. Thank you all for your time!
    www.tricitiesrussianchurch.org
    Last edited by Ukranianfreak; 04-22-2004 at 09:58 AM.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Apr 2004
    Location
    Kingsport, TN
    Posts
    13
    Thanks!!!

  4. #4
    suvat cobhc's Avatar
    Join Date
    Jan 2004
    Location
    england
    Posts
    156
    if you cant find it. Its this
    code:
    onClipEvent(load) {
    // get complete file size
    totalFileSize = _root.getBytesTotal();

    // hide progress bar
    this._xscale = 0;
    }

    onClipEvent(enterFrame) {

    // see how much has been loaded so far
    bytesLoaded = _root.getBytesLoaded();

    // convert to a value from 0 to 1
    amountLoaded = bytesLoaded/totalFileSize;

    // convert to a value from 0 to 100
    percentLoaded = int(100*amountLoaded);

    // set the scale of the progress bar
    this._xscale = percentLoaded;

    // set the text area in the main timeline
    _root.loadingMessage = percentLoaded + "%";

    // see if that is everything
    if (amountLoaded >= 1.0) {
    _root.gotoAndStop("complete");
    }
    }


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