Marcello wrotes :
> I guess that each time a swf finished loading, I would have to add the
> next swf bytesLoaded to starting from the finished bytesLoaded value of
> the last loaded SWF file. Ex: 
>
> Let´s say I have 3 SWFs, each having 30K of size. The server would return 90K.
>
>
>
> I would then create a "GlobalSwfBytesLoaded" var on the client side, this
> would be a "totalizer", every onLoad event of each SWF, this var gets
> added + the bytesLoaded of the current loading SWF... 
>
> This way I could use the formula David suggested to calc the %
>
> totalPercentDone = (GlobalSwfBytesLoaded / totalBytesFromAllSwfs) + 
> (currentSwfPercentDone / totalBytesFromAllSwfs)
>
> What do you think?
>   
In that case all swf have the same size so you don't really need the
server to return the total size, and if the swf have different size,
there you need the server to return each file size like :

10,20,60

So you can affect the right part of progress to each file.

Attila wrotes :
> take into consideration that getBytesTotal() and getBytesLoaded()
> return the uncompressed length of the swf, which is not equal with
> the actual file size of a compressed movie
>
>   Attila
You're right, a tricky way to handle that (in cas of a server side
script) is to do an approximation of the uncompressed size based on the
average compression rate, the file portion in the complete progress will
not be exact but it's enough accurate with a great number of files.

In other hand I found more clean to do that without server side script,
so I prefer deal with that problem during conception and find a way to
guarantee that files are in the same size range.

Cédric

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to