A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Preloading with a loading bar or in %

  1. #1
    Junior Member
    Join Date
    May 2002


    I looked on this site for preloading on showing me how to make a flash site load with a bar or with % but the ones I read their codes aren't working when I paste them in flash. Can you please tell me how to do these preloading tricks or give me a link to a good tutorial?

  2. #2
    Join Date
    May 2002

    % preloader

    I used the "how to create an advanced preloader" tutorial
    on this site with the code:

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

    on the first frame ( do not seperate the code even if it wants to wrap for some reason it must be in one line).The second frame has the code:

    loadPercent = Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100) + "%";
    loadBytes = Math.round(_root.getBytesLoaded() / 1024) + " Kb of " + Math.round(_root.getBytesTotal() / 1024) + " Kbtotal Loaded.";

    { loadPercent = "100%";
    gotoAndPlay ("scene2", 2);


    I followed the rest of the tutorial as it is. The preloader has only 2 frames, but the original code would not work for me (as you found it) I have a bar that fills and has two dynamic text fields-one half an inch and the other about an inch. Hope it will help you.

  3. #3
    Join Date
    Sep 2001
    Málaga, Spain
    download the fla called "preloader"

    look at the code of the first scene and the first 2 frames. when u copy this to ur own fla, notice that in the second frame it says :
    if (_root.getBytesLoaded()==_root.getBytesTotal()) {
    gotoAndPlay("Scene 2", 1);
    } else {

    of course u have to change gotoAndPlay("Scene 2", 1) and write the frame ur movie goes to when the preloading is done....

    i'm surprised the tutorials u've read don't work. i could be because u don't change some code when necessary to adapt it to ur own movie.
    let me know if u need more help

  4. #4
    Junior Member
    Join Date
    May 2002
    Thanks guys!
    It's working
    now I have to find out how to create the loading bar but I think I can find that out.

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