A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] [Help] Preloader appears late

  1. #1

    [F8] [Help] Preloader appears late

    Hi, I know this is a known issue but I haven't found any solution.
    My preloader only appears once it has loaded 32% of the game.. wich can leave some people with a blank screen for quite long if they have a slow connection.
    I think it has something to do with the loading the music on the first frame or something. (but I have to use that option or the musics won't play)

    I don't know if you need this, but just in case:
    Preloader code (first frame) I have a bar and a percentage text
    Code:
    LOADED = Math.round(getBytesLoaded());
    TOTAL = Math.round(getBytesTotal());
    PERCENT = LOADED/TOTAL;
    TEXT = Math.round(PERCENT*100)+"%";
    setProperty(BAR, _xscale, (_root.getBytesLoaded()/(_root.getBytesTotal()))*100);
    if (LOADED == TOTAL)
    {gotoAndPlay (3);}
    play();
    and on the second frame
    Code:
    _root.gotoAndStop(1);
    Thanks.
    Last edited by SnailsAnimation; 09-06-2007 at 05:08 PM.

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    some things you may have done wrong:
    - used components (bloated code for simple people, puts all it´s content before the first frame)
    - used alot attachMovie and thus linkage Id´s in the library and propably by default left the radio button "store before 1st frame". It´s basicly the same effect as the attachMovie stuff it all gets preloaded before the 1st frame (thus before your preloader) until you disable the option "store before first frame) and place the movieClips instead outside the stage on the first frame where they are needed.

    btw. your preload code is very flash4 stylish,- mind to update?, like:
    PHP Code:
    stop();
    _root.onEnterFrame = function(){
        var 
    getBytesLoaded() / getBytesTotal();
        
    TEXT int(p*100)+" %";
        
    BAR._xscale p*100;
        if(  
    getBytesLoaded() == getBytesTotal() && int(getBytesTotal()) > 0){
            
    gotoAndStop(2);
        }


  3. #3
    Senior Member
    Join Date
    Jun 2007
    Location
    Nottingham, England
    Posts
    203
    Also; if your preloader is fairly graphically intensive. Backgrounds etc; you might want to "preload the load". Insert a blank frame before your preloader frame and simply use the ifFrameLoaded(); condition.

    Hope this helps - Chris.

  4. #4
    Thank you for the tips. What I did is uncheck the "export in first frame" option in "Linkage". After that I put all the sounds that had "Linkage" in frames after the preloader, but with sync set to "stop". Now the preloader starts at 1%

  5. #5
    ...dishing dimes on an .fla! pointguard's Avatar
    Join Date
    Dec 2001
    Location
    Cambridgeshire, England
    Posts
    1,017
    I do a simliar thing, but I insert another scene in my movie after the preloader, where I place all my exported clips, etc. Then justy tell the preloader to goto and play Scene 1 (the scene after the 'skipped scene').


    probably a crap way of doing it but thats what works for me, been using that method for ages now...

  6. #6
    Not a bad idea actually

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