A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Preloader Problems!

  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    62

    Preloader Problems!

    I used the preloader from this site, but it isn't working properly.

    It doesn't load all the frames before playing.

    Does anyone know of another site that shows how to make a working preloader? (The kind with the percent done bar)



    Thanks.
    NICK

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You can download a simple one from http://www.angelfire.com/electronic2...preloader.html

    this uses the getBytesLoaded and getBytesTotal methods to find out how much of the movie is loaded. Or you can try (my prefered preloader method) of creating a separate movie that loads your actual content into a new level and preloads that. You can download an fla file for this technique from http://www.angelfire.com/electronic2...intolevel.html

    Any questions about either one please ask

  3. #3
    Member
    Join Date
    Dec 2002
    Posts
    62
    Thank you!

    How would I change it, so it loads the entire movie before it starts playing? (Using the second one)
    Last edited by ragol_67; 12-20-2002 at 04:01 PM.
    NICK

  4. #4
    Member
    Join Date
    Dec 2002
    Posts
    62
    Bump!
    NICK

  5. #5
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    you just need to have a stop(); action on frame 1 of the movie you load into the level

  6. #6
    Member
    Join Date
    Dec 2002
    Posts
    62
    I did that, but it just stops the movie, on frame one!

    When I don't have it there, I don't see the preloader bar go up at all.

    and it doesn't show the bytes or anything.
    NICK

  7. #7
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    uh,

    you need 2 files, the movie you want to preload, which has all your sites content in should have a stop(); action on frame 1. The other movie which acts as the preloader should be scripted like this,

    frame 1.

    loadMovieNum("yourmainmovie.swf", 1); // load the movie into level 1

    frame 2

    if (_level1.getBytesTotal() > 0) { // movie is loading
    loaded = _level1.getBytesLoaded();
    total = _level1.getBytesTotal();
    percent = Math.round((loaded / total) * 100);
    loadbar.gotoAndStop(percent);
    if (loaded == total) {
    _level1.play(); // start the main movie
    gotoAndStop(4); // and end this preloader
    }
    }

    frame 3

    gotoAndPlay(2); // loop back

    where loadbar is a movieclip 100 frames long that shows your loading bar animation. and frame 4 is a blank keyframe to hide the preloader once the movie has been loaded.

  8. #8
    Member
    Join Date
    Dec 2002
    Posts
    62
    Okay, I have a file called "picture1.fla", and the preloader called "loadintolevel.fla".

    I have attached the loadintolevel.fla, but I can't attach picture1.fla, cause it is too big.

    I have 6 layers. In the first layer, I have all the pictures in my slideshow. In the second and third layer, I have the 2 pictures that drop down.
    Layer 4 is the music layer, layer 5 is the actions layer, and layer 6 is the next part of the movie, after the person clicks on a link.

    I tried putting stop(); in the actions menu on just layer 1.
    Then I tried putting it in all the layers.

    I save everything.
    I close out of everything.

    And I go into my flash folder and double click on "loadintolevel.swf", it opens up the preloader bar, I am able to see that for a few seconds(during that time, nothing changes, the bar doesn't move, there are no numbers, nothing changes on the screen at all). Then it goes to the movie "picture1.swf", it starts playing that (at an alright speed, [not as fast as it should be]), then when it gets to the part in the movie where the two pictures drop down, it pauses for a few seconds, then it continues.


    What did I do wrong?

    Thank you for your help.
    Attached Files Attached Files
    NICK

  9. #9
    Young Senior Member mayhem_sci's Avatar
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    282
    on frame 3 the as should be "gotoAndPlay(2)" ?

  10. #10
    Member
    Join Date
    Dec 2002
    Posts
    62
    ^^I changed that, but it still does the same thing!
    NICK

  11. #11
    Young Senior Member mayhem_sci's Avatar
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    282
    ok, sorry, very buggy. here's the list:

    1. what i said, change frame 3: gotoAndPlay(2);
    2. frame 2: change "loadbar" to "percentbar" (u dun even know what u name ur own symbol? )
    3. you should extend your non-action layers to frame 4 also, else when movie is loaded u won't see anything. get what i mean? frame 4 should not be empty of symbols!

    right, it works on my comp now.

  12. #12
    Young Senior Member mayhem_sci's Avatar
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    282
    come to think of it, ignore 3. u probably intended that.

  13. #13
    Member
    Join Date
    Dec 2002
    Posts
    62
    arrrggg. I can't get it to work!
    NICK

  14. #14
    Young Senior Member mayhem_sci's Avatar
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    282
    here's the file i have, it works. if u test it, u wont see the preloader load at all becos it's too fast. if u include my step 3, then u will see that the preloader really do works. the streaming test in flash will not work cos it will only stream the main swf and not any loaded movies/sounds, so the only way to really test it out is to put it on the net.
    Attached Files Attached Files

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