dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: please need scripting help NOW

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    123
    (flash 5)i am using the following script for a preloader in the first of a two scene movie...when it finishes and loads the second scene , it jumps over about a quarter of the second scene and proceeds to loop 30 some odd frames...it seems to get stuck..can you figure out if there is something wrong with the script or what?..how can i fix it/figure it out?..i got a deadline, any ideas appreciated...thanks....

    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);
    }


  2. #2
    Junior Member
    Join Date
    Aug 2002
    Location
    Pakistan
    Posts
    24

    explaination..?

    Try using

    loadedbytes=_root.getBytesLoaded();
    totalbytes=_root.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);
    }


  3. #3
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    This is my preloader script i hope it helps

    var byteload = _root.getBytesLoaded();
    var bytetotal = _root.getBytesTotal();
    var ready = Math.round((byteload/bytetotal)*100);
    var kilobytes = Math.round(bytetotal/1000);
    var output = ready+"%"+" "+"of"+" "+kilobytes+"kb";
    bar1._xscale=ready
    if (ready == 100) {
    _root.gotoAndPlay("start");
    } else {
    gotoAndPlay ("loading");
    }

  4. #4
    Senior Member
    Join Date
    Jun 2002
    Posts
    123
    thanks for the effort, with your code the problem remains the same...the preloader works and counts up to 100% and then loads to a quarter way through the following scene and loops 30 frames or so...any other ideas?...

  5. #5
    Senior Member
    Join Date
    Jun 2002
    Posts
    123
    thanks webdreamer, i am trying it out now....

  6. #6
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    If you can't get it to work i suggest you download and have a look @ one of the many preloaders that can be found in the movie section.

  7. #7
    Senior Member
    Join Date
    Jun 2002
    Posts
    123
    thanks a lot webdeamer, the movies section suggestion was excellent!...

  8. #8

    WOW!

    Jeez, I was having the same problem yesterday -- Thanks webdreamer!

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