A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: simple question about getBytesloaded() and getBytesTotal()

  1. #1
    Okay, this is the first time I'm using getBytesLoaded and getBytesTotal in actionscripting, and I pulled them off successfully. I'm just have a little bit of a problem with the formatting:

    #1 - How do I get rid of the decimals? I just want to give my visitors an approximate 45k of 70K thing rather than a 45.023K of 70K thing.

    #2 - This may sound like a stupid question - but how many bytes is there in a kilobyte? Do I dived getbyteloaded by 1000 or by 1024? Just making sure that's all!

    Thanks in advance!

  2. #2
    Senior Member
    Join Date
    Dec 2000

    int() works.

    You divide by 1024, so...


    should give you the effect you're looking for.

  3. #3
    Junior Member
    Join Date
    Jan 2001
    divide by 1024

    and the decimals you round it using
    Math.round ()
    totalKB = Math.round(totalKB);


  4. #4

    Thanks a lot! :)

    THanks a lot guys!

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