dcsimg
A Flash Developer Resource Site

Page 4 of 4 FirstFirst 1234
Results 61 to 70 of 70

Thread: actionscript timer?

  1. #61
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Hmmm... now the bar doesn't exist, but the ruler and text do!

    Here is my code... whats wrong?!?!




    this.onEnterFrame=function(){
    //trace the percentage of the movie that has loaded
    percent=(_level0.HolderMC.getBytesLoaded()/_level0.HolderMC.getBytesTotal())*100;

    if(!isNan(percent)){
    if (percent == 0) {
    display = "";
    } else {
    display = Math.ceil(percent) + "% LOADED";
    this._loadbar._visible = true;
    this.ruler._visible = true;
    this.loadbar._xscale = percent;
    }
    _level0.HolderMC.stop();
    }

    if(percent == 100){
    delete this.onEnterFrame;
    this.gotoAndStop(1);
    display = "";
    this.loadbar._visible = false;
    this.ruler._visible = false;
    _parent.play();
    _level0.HolderMC.play();
    }
    };

  2. #62
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Well its time for me to go home.
    Would really appreciate either a solution, or if you could fix the file that I attached a few posts back.

    Thanks alot...

  3. #63
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Will attach my corrected version later.

  4. #64
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Here goes...
    Attached Files Attached Files

  5. #65
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Thats great... thanks.
    Had a look at the code, and it looks exactly the same as I was doing, but I had no bar! I'm going to go back and compare it with mine now, cause its bugging me to see what I've done wrong?!

    One last question.
    Now that I've got it all working, is it possible to save loading time by doing this...

    When the first bit is doing its silly "loading buttons" etc routine, is it possible to have it loading the whatwedo.swf file in the background, since its not actually using any bandwidth during that process.
    It takes about 6 seconds, which could probably load the whole whatwedo.swf on a broadband connection, and probably load about 60% of it on a 56k dial up.

    I know that there are people out there just now making sites which are 5meg and stuff, but I prefer to try and keep them as small as possible and to minimize loading times.

    Also, when checking the cached version of each file, is there a way of checking if its a newer version? If I was to update the site just now, people would still get yesterdays version appearing unless they had cleared their cache. Is it possible for flash to check if the filesize is different or something?

    Cheers...

  6. #66
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Still can't see what was wrong with my code, cause its exactly the same!
    Maybe I just didn't upload the right version!!

  7. #67
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Well you could probably be loading whatwedo, during that time... Problem is you'd probably have to load it in another holder clip since it would clear out your home page when loading up. Then you'd have 2 holder clips to manage... Could get tricky! But allways possible.

    Yes, you can add some variable on the end of the .swf's name so that it sort of forces a new download, but that could have the effect of forcing a new download every time, although maybe not in the same navigating session. I've never really tried it... Let me search it out!

  8. #68
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    I think I'll just forget about the loading bit, cause the file is only 75k or so, and I tried it on my 28k modem, and it only takes about 18 seconds! Most people are either 56k or broadband, so a <10 second wait isn't too bad.

    I would like to be able to have it reload every session though.
    What I don't want to happen is me doing updates, and people not seeing them cause there cache hasn't cleared!

    cheers

  9. #69
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Check this...

    http://www.macromedia.com/support/fl...nt_caching.htm

    I'm just not sure if all of these don't reforce a "new read" of the file on the server, even in the same navigating session, on a refresh for example. Worst case, it was your purpose!

  10. #70
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Hmmm... its a shame I couldn't just put something in the files I actually wanted non-cache.
    The majority of files will always be the same. It would just really be the client lising that would be updated regularly.

    The 'expires' one sounds like the best option though...

    Cheers

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