Solved

Wrong bytesTotal for loaded swf

Posted on 2004-10-11
8
325 Views
Last Modified: 2012-05-05
I have a preloader. It loads external swf.

In the following construction:

mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
      trace(bytesTotal);
      trace(target_mc.getBytesTotal());
}

I get only one value - 1126163 bytes. But I know that the real file size is 495965 bytes.
How could it be? How can I solve this?
0
Comment
Question by:hsmtp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 8

Expert Comment

by:Cerf
ID: 12277695
I saw once a piece of AS that used: if (_this.URL <> _parent.URL) { //preloader code}  or somethig really similar to it, and besids the code it was explained that they were waiting for the movie to be ready to start preloading, I didn't fully understand the concept behind that but maybe it has something to do with your problem...

Cërf.
0
 
LVL 6

Author Comment

by:hsmtp
ID: 12278051
Cerf,

Unfortunately it will not help me. onLoadProgress makes me sure that Flash really thinks that the file it loading is 1126163 bytes and everything is ready for preload (I'm not getting -1).
0
 
LVL 6

Author Comment

by:hsmtp
ID: 12278087
I found explaination here: http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=854993&highlight_key=y&keyword1=bytesTotal

you are seeing the uncompressed value of the swf file with getBytesTotal(). (There is an option to compress the swf in the publish settings)

But still the question to get real file size is opened.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Cerf
ID: 12278112
:(
Browser cache problem? maybe?
I know it is very simple and I bet you already have tryied that but still...
0
 
LVL 8

Expert Comment

by:Cerf
ID: 12278120
ok, I see it
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13264380
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question