A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: loading a flash movie

  1. #1
    Junior Member
    Join Date
    Mar 2000
    Posts
    13

    Post

    is there an easy way to ensure that the whole file has loaded before it starts playing? i have a small movie, but on a dialup connection it still takes a few seconds and so the objects appear one after the other rather than all at once. what is the best way to get around this?

    chundle

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    3

    Post

    The best way to do this is using the "If frame is loaded command". There are lots of tutorials on this but here is the basics of it:

    create a new scene in your movie before the main scene.

    On frame 1 put a key frame with the action:

    If Frame Is Loaded (Scene 1, 10)
    Goto and Play (Scene 1, 1)
    End Frame Loaded
    Play

    Where "Scene 1" is the name of the scene of your main movie...unless you changed it the scene name would be Scene 1 and "10" is the last frame in that movie.

    Put another keyframe on frame 2 and put the action:

    Goto frame 1

    That's it...basically the movie will continue to loop and keep checking if that last frame is loaded. Once it's loaded the movie will play.


  3. #3
    Senior Moderator
    Defender of the Faith
    Pope de Flash's Avatar
    Join Date
    Feb 2000
    Posts
    3,429

    Post

    If you want a clean reusable pre loader do this:

    label the last frame in the movie "end" it doesnt matter if its in the first scene or another scene.

    Now place a blank key frame in frame 5 and another in frame 10.

    In frame 5 put this code:

    If Frame Is Loaded (Scene 2, "end")
    Go to and Play (11)
    End Frame Loaded

    (if the last frame is in scene 2)

    then put this action in frame 10:

    Go to and Play (1)

    Now you can put a layer below this layer and put a load movie clip
    in it. Be sure to add a blank keyframe in frame 11 of this layer so the load movie clip will not be visible once the preload is done.

    Now the best part is any time you need a pre loader you can just copy these frames and drop them into your movie. All you have to do is put the "end" lable in the last frame of the movie. The other advantage to this method is if the movie gets bigger your not attached to frames but to a label which should remain at the end. regards, Bill




    ------------------
    Macromedians 1:1

    In the beginning the web was without shape and color, and the hype covered the darkness of the net. Then there was a Flash and life came to the web and vision became reality.

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