Solved

Wrong bytesTotal for loaded swf

Posted on 2004-10-11
8
326 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

622 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