A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Need Preloader

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    356

    Need Preloader

    Hi,

    Can someone please recommend a .fla or Tutorial for creating preloaders for movies that get loaded into targets?

    I've created many preloaders that work great. The preloader goes into the first scene, and when x number of frames are loaded in the Main scene, then the action takes us to the first frame of the Main scene.

    total_bytes = _root.getBytesTotal();
    loaded_bytes = _root.getBytesLoaded();
    remaining_bytes = total_bytes-loaded_bytes;
    percent_done = int((loaded_bytes/total_bytes)*100);
    bar.gotoAndStop(percent_done);
    ifFrameLoaded ("Main", "frame100") {
    gotoAndPlay("Main", "frameone");
    }


    But this type of preloader does not work for an external.swf that's loaded into a target on level0. When the button action takes place calling up the .swf that's loaded into the target, the preloader never shows up. Nothing shows up until the 'entire' .swf is loaded, and then, of course, it goes right to the first frame [frameone].

    So, is there another way to do this? Or will this type of preloader not work with movies that are loaded into targets?

    Is there another type of preloader all together that will work for this purpose.

    Thanks so much for your help.

    cheers
    Healthy Earth - Healthy Mankind - A Joyous New Millennium

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Preloaders
    Simple Preloader with one movie loaded to level
    Simple Preloader with one movie loaded to target
    Multiple Preloader with x movies loaded to levels
    Multiple Preloader with x movies loaded to targets
    Multiple Preloader with x movies (incl. percent and bps)
    Multiple Preloader with x movies (single and multiple percent and bps)

    http://www.bokelberg.de/actionscript/

    Advanced Flash Preloader Learn how to properly preload Flash movies that use components.
    Basic Flash Preloader Learn the basics of creating a preloader for basic Flash movies.

    http://gotoandlearn.com/download.php

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    356
    I'm still having trouble getting anything to work.

    I've built a small set of sample.flas that mimic my project. They are attached. If someone could take a look at my code [button & preloader], and tell me what is wrong, I'd be EXTREMELY grateful.

    Essentially, my nav button needs to load a .swf into a target. In real life, this .swf is quite large, and so needs a preloader.

    Thank you, a million thank yous.
    Attached Files Attached Files
    Healthy Earth - Healthy Mankind - A Joyous New Millennium

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    356
    After some further testing, it seems the code in the 'Nav.swf' button is not working. I don't know why it isn't working. I'd be very grateful if someone could help me out with this.

    Also, I'm using Flash 8, but configured for AS 1 because of some other older code I have to use.

    Thanks so much.
    Healthy Earth - Healthy Mankind - A Joyous New Millennium

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the movieclip instance target is on the _level0 timeline, so use -

    on (release) {
    _level0.target.loadMovie("1.swf");
    }

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    356
    Yes, got the button [and preloader] working now. Thanks so much!
    Healthy Earth - Healthy Mankind - A Joyous New Millennium

  7. #7
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    you're welcome

  8. #8
    Senior Member
    Join Date
    Jul 2000
    Posts
    356
    Actually, I have one last question. The movie I'm 'preloading' is quite large. But it doesn't have to be TOTALLY loaded before the visitor can start looking at it. I'd like the preloader to go to the 'content' part of the movie when it's about HALF loaded. However, I"ve tried modifying the code I ended up using, and it only seems to work in its original form, i.e.:

    total_bytes = this.getBytesTotal();
    loaded_bytes = this.getBytesLoaded();
    remaining_bytes = total_bytes-loaded_bytes;
    percent_done = int((loaded_bytes/total_bytes)*100);
    bar.gotoAndStop(percent_done);
    if (percent_done == 100) {
    this.gotoAndPlay("main scene");
    }


    I tried changing *100 to *200 and '...done == 100' to '...done == 50', and that works if I 'simulate download' in Flash / Test mode, but does not work in real life. The preloader just freezes.

    Is there a way to modify the preloader code so that it will load the movie once it is HALF loaded?

    Thanks again.
    Healthy Earth - Healthy Mankind - A Joyous New Millennium

  9. #9
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    But it doesn't have to be TOTALLY loaded before the visitor can start looking at it
    . not true. too hard on the cpu (display+loading). Cut that movie in half if possible.

    gparis

  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    356
    Gosh, I've used lots of other preloader codes that used 'labels'. I could place a label part way through the actual movie, then the preloader would start the movie at the beginning once it was loaded up to that label [usually a third or half way through].

    So it would start displaying while it finished loading.

    Always worked fine. I've just never used this particular code before.
    Healthy Earth - Healthy Mankind - A Joyous New Millennium

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