A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: connection speed

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Posts
    412

    connection speed

    Hi All,

    I've just been trawling the forums for some info about detecting an end users connection speed, ie: to determine whether it is modem/dsl etc...

    I found one thread that contained code which apparantley works perfectly.

    This is the code:
    if (_root.getBytesLoaded() == _root.getBytesTotal()) {
    gotoAndStop(3);
    } else {
    bytesLoaded = _root.getBytesLoaded();
    bytesLeft = _root.getBytesTotal()-_root.getBytesLoaded();
    bytesTotal = _root.getBytesTotal();
    kbytesLoaded = Math.round((_root.getBytesLoaded()/1024)*100)/100 add " K";
    kbytesLeft = Math.round((_root.getBytesTotal()-_root.getBytesLoaded()/1024)*100)/100 add "K";
    kbytesTotal = Math.round((_root.getBytesTotal()/1024)*100)/100 add " K";
    percent = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100) add "%";
    loadBar = int((_root.getBytesLoaded()/_root.getBytesTotal())*100);
    time = (getTimer()/1000);
    bps = bytesLoaded/time;
    bits = bps/1024;
    Kbps = Math.round(bits*10)/10 add " Kbps";
    }

    Can anyone explain to me how this should be used ie: what to attach the code to (frame or mc) and how I can define the relevant version of my site to use (modem or faster connection version).

    Any help or pointers or other suggestions will be much appreciated.

    Diggz

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  3. #3
    Senior Member
    Join Date
    Oct 2002
    Posts
    412
    how about that?! I never even thought to look in the movies section for it!

    Thanks very much.

    =)

  4. #4
    Senior Member
    Join Date
    Oct 2002
    Posts
    412
    Just been looking at the link above to the movie for detecting download speed. Seems to be exactly the thing I am looking for, but...

    ...can anyone tell me how to do the following:

    how I can add some function to direct them to the specific movie ie: smaller less intensive version for a modem and larger and more complex movie for adsl or T1 etc...

    Also what does cache enabled mean? is it at their end or is it something that I am able to control?

    Hope you can help out as I seem to be so close yet a mile away from the result I hope to achieve.

    Diggz

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