dcsimg
A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 57

Thread: Lil Preloader help

  1. #1
    Junior Member
    Join Date
    Aug 2003
    Posts
    22

    Lil Preloader help

    hey,
    I have created a flash movie with a preloader scene and a main movie scene. Everything seems to be in order when I go through debugging it at 56k but when I posted the .swf on the internet, the preloader doesn't show. What seems to be happening is that the browser won't show the movie until it's all downloaded and thus defeating the purpose of the preloader. The movie just sits there as a white screen until the .swf is loaded in it's entirety. Thanks for the help

  2. #2
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    so you made two different scenes... Why don't you try putting everything on the same scene(first convert your preloader into a movieclip): put the preloader on first frame, give it a stop action, then on the other frames continue with your movie..
    On the "Enter" button, you insert this script:
    on(release){
    _root.gotoAndPlay(2);
    }

    Hope that helps,
    Manojo

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    Tried it and it stil doesn't work. Could it be something with the html? Do I have to do anything special when I put flash up in the web page to make it show the preloader before everything else is loaded?

  4. #4
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    When you go to File-Publish Settings, Click flash tab, what is the load order set at Bottom up or top down. Try changing that setting.

  5. #5
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    Thanks but it still doesn't work. I'll attach the action script Im using and see if it helps.

    Scene One, Frame One:
    My preloader bar movie (just a simple mask job)

    Scene One, Frame Two:
    loadedbytes=getBytesLoaded();
    totalbytes=getBytesTotal();
    loadedkbytes=Math.ceil (loadedbytes/1000);
    totalkbytes=Math.ceil(totalbytes/1000);
    if (loadedbytes == totalbytes) {
    nextScene ();
    }
    frame = int(loadedbytes/(totalbytes/100));
    tellTarget (_root.loader) {
    gotoAndStop (_root.frame);
    }

    Scene One, Frame 3:
    gotoAndPlay (1);

  6. #6
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    the url for the progress on the .swf so far is:
    http://home.comcast.net/~a.condrea/preloader.swf

  7. #7
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    Does the MC or graphgic for your preloader persist in frame 2 and 3 as well as frame 1, or is your preloader MC only in frame 1?

    If you could y dont u attach the source files


    BTW, should this take a long time to load, or only a few seconds, cause when I wen to that page it came up almost instantly.

  8. #8
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    also, after looking at it again it seems that when I hit refresh it starts right where it should. It leads me to believe that the movie never plays the preloader or it is set up on the scene after the actual movie. What I mean is, lets say your preloader is on scene 1 and your movie is on scene 2, it looks like your movie starts at scene 2, and scene one comes after that, so you never actually see it. Check the order of your scenes and make sure that the one with the preloader is set to play first.

  9. #9
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    for the preloader scene, the bar MC persists through scene 3. How do I make sure that the preloader scene loads first? I have the "preloader" scene on top of the "main" scene and in the publish settings under flash I have the load order on "top down." The reason that it might take no time to load is because I was workin on it and noticed that the preloader was not working properly so the main movie is not even complete. To a broadband user, it would seem like nothing to download it but the problem is... those dang 56k'ers

  10. #10
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    In the Menu bar of flash when you go to:
    Modify - Scene

    Which one is on top?

    See the thing is, it seems like it is not playing the preloader at all. I mean when you hit refresh on your page you should at least see the first three frames which have the preloader. What happens when you do test movie from flash, does the preloader come up?

  11. #11
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    Preload scene is on top. When I do the test and show streaming... it works seamlessly

  12. #12
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    That preloader script has never worked flawlessly! Get a better one!

  13. #13
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    I haven't seen a better one that's actually worked the way I wanted it. I have a movie of a logo in black/white that fills with color to the percentage. All the other preloader scripts I've seen just have you loop through the movie and give no correlation between how far the bar has filled and percentage.

  14. #14
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    There is something amiss, you are gonna have to attach the file in your next post if you want me to help you. It just doesn't make sense, when I hit refre3sh on the page it should be showing the preloader for at least 2 frames. Try adding _root in front of getBytesLoaded and getByteTotal functions. In fact, if you dont want top attch your code, just take out the line that says

    if (loadedbytes == totalbytes) {
    nextScene ();
    }

    and repost it to your site temporarily

  15. #15
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    http://home.comcast.net/~a.condrea/debug.swf

    I took the line you requested out and put the _root. command in. Im workin on uploading the stripped down .fla (without vids)

  16. #16
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    http://home.comcast.net/~a.condrea/debug.fla

    Here's the FLA without movies. I also wanted to say thanks a lot for the help.

    :edit: *note* the debug .fla doesn't have the ifbyteloaded == totalbytes command and thus doesn't go to main movie, you have to re-insert it.
    Last edited by DC5 Master; 08-19-2003 at 08:19 PM.

  17. #17
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    hmmmmm......
    Its weird, i tried publishing it to a friends server and it seems to work fine. Are you sure that you are uploading the right .swf file.
    One more thing to change is in frame three, instead of calling:

    gotoAndPlay(1)

    write:

    gotoAndPlay(2)

    and change:

    if(loadedbytes==totalbytes){
    nextScene();
    }

    to

    if(loadedbytes==totalbytes && loadedbytes > 0){
    nextScene();
    }

    But, the other thing is the preloader itself takes a little while to load, maybe change the graphic to something smaller in size.

    Good luck, let me know if you get it working.

  18. #18
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Both of you do know, I assume, that the nextScene() action is not a play action. It's exactly as nextFrame() and prevFrame()... It goes to the next frame or the previous frame and stops. So does the nextScene() action. That's only one bug of that preloading code.

    _root is in fact missing in the getBytesLoaded() and getBytesTotal() calls.

    Then "if (loadedbytes == totalbytes) {..." is wrong, it should be...

    if (loadedbytes >= totalbytes) {...

    Lastly, the whole...

    frame = int(loadedbytes/(totalbytes/100));
    tellTarget (_root.loader) {
    gotoAndStop (_root.frame);
    }

    ...bit, is a total aberration! Most of the time, this will only have a tendency to send your movie to frame 100, and if it doesn't exist (if you have less than 100 frames in your movie...), will simply send your movie to it's last frame...

    But who wants to listen to me!

  19. #19
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    1. The first frame of scene 2 tells the movie to play

    2. You do not need _root in front of getBytesLoaded() if it is in a frame on the root timeline.

    3. how could bytesloaded ever be greater than bytesTotal.

    4. there are 100 frames in _root.loader and why wouldnt that work?

    The code may not be the most efficient, but it should work.

    I know you have been here for a long time and done many posts, but in this case you are wrong.

  20. #20
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Fine! Make it work!

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