A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Getting the download speed of a movie!!!

  1. #1
    Member
    Join Date
    Feb 2001
    Posts
    31
    Can anybody PLEASE help me with how to show the download speed of the user while loading the movie? you can find the example of it on http://www.dubit.co.uk . PLEASE HELP ME! IM A NEWBIE!

  2. #2
    Junior Member
    Join Date
    Jul 2001
    Posts
    8
    k, here comes my way of solving this task, hopefully mathematically correct
    If there are any errors or mistakes in the code, tell me. I'm quite new to flash too, btw.

    I tried this code by loading an external swf into a host MC
    (you guess, called host) via the loadMovie() command on _level1.
    I made a seperate MovieClip on the main timeline with the follwing sourcecode:
    -8<------------------------------------------------------

    onClipEvent (load) {
    now=0;
    last=0; //Initialisation
    frame=1;
    }

    onClipEvent (enterFrame) {
    frame += 1;
    if (_parent.host.getBytesTotal() > 0 && frame % 12 == 0) {

    // I took the modulo operator to point only at full seconds
    // My framerate was 12 frames/second

    now = _parent.host.getBytesLoaded();
    _parent.transfer = math.round(now-last);

    //transfer is my dynamic text field with the "live"
    //framerate - means refreshed every second

    last = now; //swap 'em
    }

    _parent.average = math.round (_parent.host.getBytesLoaded()/frame*12);

    //divides by its already played frames and multiplies with
    //the movies framerate - "average framerate"

    }
    -----------------------------------------------------------

    I hope this will help you. Once again, I take no responsibility for its correctness, 'cause its deepest night and I have no ambition to test it with my stop watch - but everything seemed okay for me.
    ((since I had constant lousy 4k on my 56k modem *sigh*))

    greets
    ron
    [Edited by R0N on 08-02-2001 at 07:16 PM]

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