[osflash] "splitting" the load percentage feedback in different stages

Marcelo de Moraes Serpa celoserpa at gmail.com
Sat Jul 1 09:23:44 EDT 2006


Maybe something like this? Keeping in mind that totalBytesFromAllSwfs would
come from the server... Haven´t tested it though...

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?

Marcelo.

On 7/1/06, Marcelo de Moraes Serpa <celoserpa at gmail.com> wrote:
>
> >As I know, the only way to do that is to use a server-side script that
> >return the size of each files you want to load, because in AS the
> >getBytesTotal method return the value you want only after calling the
> >loadMovie method.
>
> Yes Cédric, that´s what I thought. I guess that implementing such schema
> using a server side script to return the total size in bytes of the swf
> would be indeed the only way. I´m still thinking on how to find the
> bytesLoaded based on this value returned from the server.
>
> Marcelo.
>
>
> On 7/1/06, Cédric Néhémie <cartel.com at free.fr> wrote:
> >
> > Hi list,
> >
> > As I know, the only way to do that is to use a server-side script that
> > return the size of each files you want to load, because in AS the
> > getBytesTotal method return the value you want only after calling the
> > loadMovie method.
> >
> > In most of cases the queue loading works fine (when you want to load a
> > large number of icons, sound loops in a mixer, or sprites for a game
> > level) because there isn't too wide differences between files size. But
> > if you have big and small files to load in one step I found cleaner to
> > do that in 2 steps instead (in general the big files haven't the same
> > usage in the apps > background of a game, backround sound of a game:
> > big, sprites, effect sounds : small). But if the rhythm of the progress
> > is not your preoccupation, so you can use a single queue to load all
> > your files.
> >
> > Marcelo de Moraes Serpa wrote:
> > > Hmmm... What would be the best way to find and sum the bytesTotal of
> > > all the SWF´s in the LibStack (pixlib) and then get the bytesLoaded
> > > based on this sum (no on an individual SWF)? Is there a way to do
> > > that? This way, I could base the percentage on the total bytes loaded
> > > of all the SWF´s in the library preloader instead of basing on the
> > > number of SWF´s loaded...
> > >
> > > Thanks!
> > >
> > > Marcelo.
> > >
> > > On 7/1/06, *Weyert de Boer* < mailings at innerfuse.biz
> > > <mailto:mailings at innerfuse.biz>> wrote:
> > >
> > >     You might want to consider using the queueLoader class. This class
> > >     will
> > >     give a sign when the queue is completed, and for every item
> > >     loaded. This
> > >     way you can easily make such preloader :)
> > >
> > >     Yours,
> > >     Weyert
> > >
> > >     _______________________________________________
> > >     osflash mailing list
> > >     osflash at osflash.org <mailto:osflash at osflash.org>
> > >     http://osflash.org/mailman/listinfo/osflash_osflash.org
> > >     <http://osflash.org/mailman/listinfo/osflash_osflash.org>
> > >
> > >
> > >
> > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > osflash mailing list
> > > osflash at osflash.org
> > > http://osflash.org/mailman/listinfo/osflash_osflash.org
> > >
> >
> >
> > _______________________________________________
> > osflash mailing list
> > osflash at osflash.org
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20060701/563a3509/attachment.htm


More information about the osflash mailing list