A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: how do you test preloader in Test Movie?

  1. #1
    Member
    Join Date
    Apr 2001
    Posts
    76
    hey... another question...

    how do i test my preloader in the Test Movie?

    when i use Test Movie the file is already 100% loaded so i dont know if my preloader is workin or not. is posting it in the web the only way to test if the preloader is working? thanx in advance. peace and prayer

    alex

  2. #2
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    after you press ctrl/enter.

    look up at your toolbar
    goto debug, set it at 56k,
    or what connection speed you want
    press ctrl/enter again
    your preloader should appear.
    also...
    press ctrl/b
    this is your bandwidth profiler
    it will give you some good info.

  3. #3
    That ctr/enter thing is awesome. How can i get that information in the bandwidth profiler? It has a percentage loaded and everything. I want to be able to get that number in flash to ease the creation of preloader creation. Is this possible? Thanks

  4. #4
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    i dont understand what you're asking...

  5. #5
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by denmark219
    percentage loaded... I want to be able to get that number
    Code:
    percent = ( getBytesLoaded()/getBytesTotal() ) * 100;

  6. #6
    so if I make 2 keyframes in a preloader scene, and have:
    Frame 1:
    if (getBytesLoaded() == getBytesTotal() ){
    gotoAndPlay(Main, 1);
    }

    Frame 2:
    gotoAndPlay(1);

    That will work for a simple simple preloader?

  7. #7
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    yup... quotes around the scene name of course...

  8. #8
    beautiful guys. Thanks alot for the help. Much appreciated.

  9. #9
    Member
    Join Date
    Jul 2002
    Posts
    69
    Eh...I'm a little confused. I've been using ifFrameLoaded
    instead of if (getBytesLoaded() == getBytesTotal() for my preloaders, and it works fine. Are these just two different ways of doing the same thing? Or is your preloader a more complicated (like a bar) loader?

  10. #10
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by fuktifino
    Eh...I'm a little confused. I've been using ifFrameLoaded
    instead of if (getBytesLoaded() == getBytesTotal() for my preloaders, and it works fine. Are these just two different ways of doing the same thing? Or is your preloader a more complicated (like a bar) loader?
    i'd get in the habit of using _framesloaded, _totalframes, getBytesLoaded and getBytesTotal. ifFrameLoaded will probably be gone in the next version of flash. you can do much more with those as well (as you said, preload bar and also diaplaying percent).

  11. #11
    Member
    Join Date
    Jul 2002
    Posts
    69
    Thanks for the tip Right now I use one image, throw it through Jasc animation shop to get frames for an 'effect', and that's my preloader, so I hadn't been using the getbytesloaded option. I'll start though, even with my weak preloaders.

  12. #12
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    getBytesLoaded can be used on the simplest of preloaders. Doesn't need a bar. I used the following code for static text that changed colors ever second. Didn't need a preload scene or anything more that a separate layer for the Labels and actions.



    Code:
    MovieSize = _root.getBytesTotal();
    LoadedSize = _root.getBytesLoaded();
    PercentLoaded = LoadedSize/MovieSize;
    if (PercentLoaded <.8) {
        gotoAndPlay("Preload");
    } else {
        gotoAndPlay("MovieStart");
    }

  13. #13
    Member
    Join Date
    Jul 2002
    Posts
    69
    This http://www.wiccasworld.com/gothloader1.swf is an example of one of my loaders. Like I said, they're about as basic as they come. The effects are from animation shop, not something I've made myself. I have some with light beams shining across them from behind, and one where the word Loading slides off the page like it liquified and ran, if that makes sense. I've yet to delve deeper into preloaders and work out for myself how to do the bar/percent loaded types.

  14. #14
    Senior Member
    Join Date
    Sep 2002
    Posts
    265
    any of you guys know how to make a preloader for an external SWF file without loading the SWF into a clip? The only example i've seen using a SWF preloader dumps the movie into a clip, and that doesn't work (it screws up all my variables).

  15. #15
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Load it on another level!

  16. #16
    Senior Member
    Join Date
    Sep 2002
    Posts
    265
    stop();
    _root.loaderBar._visible = false;
    _root.preHolder.loadMovie("advanced_search.swf");

    onClipEvent(enterFrame){
    if(this._url != _root._url && !this._url.loaded) {
    var kilobytes = Math.ceil(this.getBytesTotal()/1024);
    _root.frame = Math.ceil((this.getBytesLoaded()/this.getBytesTotal())*100);
    _root.loaderBar.gotoAndPlay (_root.frame);
    _root.frame = "loading " + _root.frame + "% of " + kilobytes + "kb";
    _root.loaderBar._visible = true;
    if(this.getBytesLoaded() == this.getBytesTotal()){
    this._url.loaded = true;
    _root.gotoAndStop("start");
    }
    }
    }


    OK, there's the batch of code I used for this. As you can see, its reliant on the fact that it's dumping the SWF into a clip.

    If i load it into another level,
    _level1.loadMovie("advanced_search.swf"); *I'm assuming*

    how do i make a preloader?

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