A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: this f***ing preloader

  1. #1
    Browsing
    Join Date
    Dec 2000
    Posts
    105
    who solved this problem...
    i just want a loader bar (simple) to show the progress
    but all that i have tried they are starting the preloading
    after ~20% becose of the (export in first frame function)

    im realy sad...(in flash 5 was a piece of cake)

    anyway....
    if sombody have a script for a simple one. with a progress bar please post it...


    thanks

  2. #2
    This can be found in the tut. on this site (try searching)

    1. frame:

    // initialize text fields
    loadpercent = "0%";
    loadBytes = "0 of "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb";

    2. frame:

    loadPercent = (Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*100)+"%");
    loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1000)/1000+" Kb of "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb total Loaded.");
    if (_root.getBytesLoaded() == _root.getBytesTotal()) {
    // Check for finished loading
    // If loaded, final update to fields
    loadPercent = "100%";
    loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1000)/1000+" Kb of "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb total Loaded.");
    gotoAndPlay("your label");
    // Where to go once your movie is loaded
    }

    3. frame:

    gotoAndPlay(2);
    // Loops back to continuosly update text fields

    you'll need a MC called "LoadBarFill"

    1. frame in mc:

    // scale bar horizontally in relation to amount loaded
    this._xscale = ((_root.getBytesLoaded()/_root.getBytesTotal())*100);

    2. frame in mc:

    gotoAndPlay(1);

    on the 1. frame in mc make a progressbar.

    then you'll need 2 text fields on the main stage with the var. "loadPercent" and (a bigger one) "loadBytes"

    get it?

    should work

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    yea i had that same problem... search the forums because i know that old newbie and someone else posted working preloaders. the problem was is that the ui components export in the first frame (like you said) but before any visuals show or any other actions are done... it kind of sucks... a lot... but yea, search for forum for oldnewbie and preloader, im sure you will find tons of threads dealing with this issue.

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    I have found that creating a preloader movieclip works better than just putting a code on the root timeline.
    You might want to try that. and make the bar longer than what it would be when site loads.

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