A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: preloading a swf once, not again and again

  1. #1
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159

    preloading a swf once, not again and again

    i have a loading script which i "borrowed" () from a few different sources, and combined to make my own. it works really well, but i notice that it loads the movie every time.

    what i mean is, it'll show the 0-100% preloading bar load up the movie then play the movie itself. however, if i leave the site, then want to go back and watch my movie for the second time, it runs through the whole preloading process again, instead of just playing the movie (since its already loaded and in my cache)

    so, my question is; is there any sorta script i could add that would check to see if the movie has already been downloaded?

    i've zipped up the FLA, in case you can look at it

    thanks

    http://www.phausenentertainment.com/load.zip
    i'm not new to action scripting. i'm just bad at it.

  2. #2
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    woo! third page!

    this forum moves quicker than i remember

    a big and hopeful BUMP!
    i'm not new to action scripting. i'm just bad at it.

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Would have to see your code... You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.
    Can't open your .fla.

  4. #4
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    i'm not new to action scripting. i'm just bad at it.

  5. #5
    Member
    Join Date
    Jul 2004
    Posts
    36
    i cant attach fla as it is too big.
    replace the code in clip events layer in movieclip with this; its the lot so just cut and paste over whats there now.
    !!have tested it serverside and works fine when you return!!


    onClipEvent (load) {
    total = int(_root.getBytesTotal());
    }
    onClipEvent (enterFrame) {
    StatusColor = new Color(_root.Bar);
    Loaded = _root.getBytesLoaded();
    Percent = Math.round(loaded/total*100);
    if(Percent==100){
    _root.gotoAndPlay("19");
    }
    if (percent>01) {
    StatusColor.setRGB(0xf6f6f6);
    }
    if (percent>20) {
    StatusColor.setRGB(0xf6f6f6);
    }
    if (percent>40) {
    StatusColor.setRGB(0xf6f6f6);
    }
    if (percent>60) {
    StatusColor.setRGB(0xf6f6f6);
    }
    if (percent>80) {
    StatusColor.setRGB(0xf6f6f6);
    }
    if (percent == 90) {
    StatusColor.setRGB(0xf6f6f6);
    }
    _root.Percent = Percent+" %";
    setProperty("_root.Bar", _xscale, Percent);
    if (Percent>=100) {
    tellTarget ("_root") {
    play();
    }
    }
    }

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