dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Something very weird in Flash MX

  1. #1
    Junior Member
    Join Date
    Sep 2001
    Posts
    7
    When I made a preloader for this movie today, I noticed something very weird: my .swf file was 200 KB, but the preloader insisted that the movie was 600 KB (with the _root.getBytesTotal() command).
    This seemed very strange to me, so I decided to figure out what was wrong. I did that by removing the items in the library one by one and checking the value of _root.getBytesTotal() for each removal. Finally I found out that the "sinners" was two texts which I had broken apart (Ctrl-B) and Flash had obviously treated them as bitmaps when calculating the size of the movie, but the really strange thing here is that it doesn't treat them as bitmaps when compressing the movie into an .swf file. That explains why the movie was 222 KB, but the _root.getBytesTotal() was 600 KB.

    As far as I see, this must be an error in Flash MX (I haven't tried with other versions), but please download the .fla file below and tell me if you find a logical explanation to this.

    To see it for yourself, you should open the .fla file and test movie. The red number in the middle shows the _root.getBytesTotal() value on startup. Compare this to the size of the .swf file. It will differ (600KB - 222KB).
    Then remove the two objects "selve visionsteksten" and "selve omteksten" and try again to compare the _root.getBytesTotal() with the size of the .swf file. This time, they will be almost equal.

    If no one finds an explanation to this, should I then send this mail to Macromedia?

    The .fla file:
    http://www.baboo.dk/flash/mxerror.fla

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    298
    Ah yes, I see your problem. What's happening is that the getBytesLoaded() function returns the size of the uncompressed swf. Since FlashMX now allows you to compress the movie the actual size of the swf will often be different to the one reported.
    The result of this is that when downloading the swf you will appear to get download speeds higher than the theoretical maximum.

    I wouldn't say this is a bug as such, getBytesLoaded() returns the correct size of the swf. It's accurate, but Flash is capable of making the swf smaller than it actually is.

    The reason your figures get closer when you remove those movies is cause those movies happen to be ones that compress quite well.

  3. #3
    Junior Member
    Join Date
    Sep 2001
    Posts
    7
    Originally posted by C4_Tom
    Ah yes, I see your problem. What's happening is that the getBytesLoaded() function returns the size of the uncompressed swf. Since FlashMX now allows you to compress the movie the actual size of the swf will often be different to the one reported.
    The result of this is that when downloading the swf you will appear to get download speeds higher than the theoretical maximum.

    I wouldn't say this is a bug as such, getBytesLoaded() returns the correct size of the swf. It's accurate, but Flash is capable of making the swf smaller than it actually is.

    The reason your figures get closer when you remove those movies is cause those movies happen to be ones that compress quite well.
    ok, thanks a lot. Then I will just accept that and divide the getBytesTotal() with 3 just as I will divide the getBytesLoaded() with 3.

    I've found that it reduces the size of the .swf file considerable (from 200 KB to 78 KB) when I do the following: I open the two texts symbols that has been broken apart and take a screenshot of each of them. Then I open them in Photo-Paint and saves them as 6-color .gif's. Then I move those two .gif's into Flash again and delete the old symbols.

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