A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Preloader help

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    9
    I am trying to create a preloader that has a progress bar, and at the same time has a percentage that follows the position of the bar. Anyone?


  2. #2
    Senior Member
    Join Date
    Jun 2002
    Posts
    217

    Easy

    First off, look for a tutorial before you ask here...there are thousands of them.

    Anyway, make little bar that will look like your 100% mark, turn it into a symbol. Then name the symbol "loader" (without the quotes) AND MAKE SURE YOU NAME THE INSTANCE "loader" (without the quotes) otherwise NOTHING will work.

    Then edit the symbol, make a keyframe in frame 100, and then make frame one tween to frame 100.

    Copy frame one, (right click > copy frame(s)), make a mask of layer 1 with your tween in it, then make a new layer and paste the frame you copied into the new layer.

    Now you make that new layer into a mask, right click the layer and choose mask. Make sure that the new layer, the mask, is in frames 1 through 100.

    Now that that is done, the actionscripting begins, it's simple.

    Put this in frame 2:

    Code:
    loadedBs = getBytesLoaded();
    totalBs = getBytesTotal();
    loaderFrame = int(loadedBs/(totalBs/100));
    tellTarget (_root.loader) {
        gotoAndPlay(_root.loaderFrame);
    }
    if (loadedBs == totalBs) {
        gotoAndPlay("scene2", 1)
    } else {
        gotoAndPlay(1);
    }
    Done...

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Posts
    9

    still need help

    ok, I know how to do that, but what I am looking to do is kinda like 2Advanced studios, with a percentage that is animated, and follow the progress of a bar
    go to http://www.2advanced.com/flashindex.htm, under exploritory, hit sequence 01_quotient and see what i mean.

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    A percent textfield within a movie clip moving (on the x scale) according to the percent loaded?

  5. #5
    Junior Member
    Join Date
    Jun 2002
    Posts
    9
    yes, exactly!

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Well, there's your answer!
    Guess you now want one of us here to build it for you?

  7. #7
    Junior Member
    Join Date
    Jun 2002
    Posts
    9
    Originally posted by oldnewbie
    Well, there's your answer!
    Guess you now want one of us here to build it for you?
    haha! That would be great! This has been killin me for about a week!

  8. #8
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    first of all, I prefer putting da preloader in a single frame in a "preload" scene (this works easy when your whole site is made on the first frame of the "main", and only other, scene)...
    anyway..
    there are several ways you can achieve such effects..
    like:
    (you just need to create a loading bar and a textField. and place this code in the only frame on the stage)
    Code:
    bar.onEnterFrame = function() {
        LOADED = _parent.getBytesLoaded();
        TOTAL = _parent.getBytesTotal();
        PERC = Math.round(LOADED/TOTAL*100);
        this._xscale = PERC;
        textField._x = this._x + this._width;
        textField.text = PERC + "%";
        textField.autoSize = "Left";
    };
    this should work, if you want something more advanced (like the preloader i've put on http://www.pasodesign.com/) just ask!

    hope this helps!

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Here's one that does it...
    Adapt it!

    http://virtual-fx.net/vfx/tutorial/t...8_20020107.php

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