A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Preloader 1001

  1. #1
    Member
    Join Date
    May 2004
    Posts
    47

    Preloader 1001

    Hi I have a litle problem with my preloader.

    In my preloader movie I have this script( see below) where I load "index.swf" into "holder".

    When I test it, it will only output 0% and 100% loaded,
    when I try to set down the bandwidth to see the progress it will not show the percentage

    anyone knows why?

    regards Thomas

    The script

    this.createEmptyMovieClip("holder",1);
    holder.loadMovie("index.swf");
    this.onEnterFrame=function(){
    //trace the percentage of the movie that has loaded
    percent=(this.holder.getBytesLoaded()/this.holder.getBytesTotal())*100;
    if(!isNan(percent)){
    trace(percent+"% loaded");
    }else{
    trace("0% loaded");

    }
    if(percent == 100){
    delete this.onEnterFrame;
    }
    }

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This won't work when testing the loaded movie locally... But will if tested online, and assuming your internet cache was cleared between tests.
    If you want to test it locally, upload the "to be loaded" movie to some web space, and use that full online url instead in your script. Once again make sure your internet cache is cleared between each test, or append an unique number to your .swf's name, so that the cached file is never re-loaded.

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