A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: I can't get preloaders to work

  1. #1
    Member
    Join Date
    Jan 2001
    Posts
    38
    no matter what preloader i try it never works. is it me or am i just stupid? haha

  2. #2
    Junior Member
    Join Date
    Jan 2001
    Posts
    24
    No your not stupid, it took everyone a few tries before they got it too espically if they didn't have anyone helping. I am assuming you know the various types of preloaders since you say you have tried different ones. So here is a easy one, and also a probable reason why it seems its not working.

    Simply put (i will take this from creating a new movie stand point), in your new movie create a new scene and rename it 'preloader'. and while you are at it rename the other scene (probably named scene 1) to main movie. Then make sure that the preloader occurs before the main movie does. you can do this by looking at the scene panel. which ever one is on top is the one that comes first.

    now, go into the preloader scene and create a symbol (make it a movie) then edit that movie because this will be the animation that you want to occur while the movie is loading.

    So. now the moment of truth. In the preloader scene, which only has one layer in it, and one frame (right?) because we haven't added anything. What I usually do is make a second layer and name this actionscript. Now the first frame of the preloader will be blank because in it we are going to place a actionscript wich will check to see if the movie has been loaded yet, assuming that is has not been loaded it will advance to the loop that will have the preloader animation you created earlier in it. Here is a example of this script to be put in frame 1 (note flash 5 but it shouldn't matter)

    stop ();
    if (_framesloaded = _totalframes) {
    gotoAndPlay ("main_movie", 1);
    }
    play ();

    So IF the total frames of the movie has not been loaded it plays your preloader animation. if it has then it goes to the main movie ok.

    If the movie has not been loaded this is what I do.

    In frame 2 of the preloader on the layer 1 you put your preloader animation and extend it out to frame three. and that is all set

    now we create the loop which will constantly check. On layer 2 (which we renamed actionscript) in frame 2 we put the same thing we had in frame 1. simple.

    In frame 3 on the action script layer, we put the same thing we had in frames 1 and 2 but we modify it ever so slightly to say this:

    stop ();
    if (_framesloaded = _totalframes) {
    gotoAndPlay ("main_movie", 1);
    }
    gotoAndPlay (2);

    This way it appears that the movie isn't doing anything except preloading your main movie, but it is really jumping back and forth on frames 2 and 3 constantly checking to make sure it's loaded while playing your flowers that spin or whatever.

    sound good. hope this helps, took a while to write out. if you need a sample fla let me know. OH and the reason why you think your preloader is not working may be because you are testing it out on your hard drive. post it to the net and check, that's the only way to really know. later.

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