Re: [Flashcoders] getBytesLoaded() and actions execution
I've occasionally seen my getBytesTotal script get fired at just the right time when the file header info hasn't quite been read in yet and it thinks that the getBytesTotal and getBytesLoaded are both 10. So I usually have loaded.getBytesLoaded() == loaded.getBytesTotal() && loaded.getBytesTotal >100 Muzak wrote: Is it safe to assume that as soon as loaded.getBytesLoaded() == loaded.getBytesTotal() actions in first frame of the loaded 'loaded' movieclip were executed ? calculate and use percentage: var l:Number = loaded.getBytesLoaded(); var t:Number = loaded.getBytesTotal(); var p:Number = Math.floor((l/t)*100); if(p == 100) { // loading is done // but loaded clip might not be ready yet } Best is to use MovieClipLoader and its onLoadInit event though. http://livedocs.adobe.com/flash/9.0/main/2001.html regards, Muzak ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] getBytesLoaded() and actions execution
as an aside, if you're loading multiple movies, can you use the same moviecliploader object or should you use different objects? You can use 1 MovieClipLoader instance. - Original Message - From: "Allandt Bik-Elliott (Receptacle)" <[EMAIL PROTECTED]> To: "Flash Coders List" Sent: Saturday, February 09, 2008 6:30 PM Subject: Re: [Flashcoders] getBytesLoaded() and actions execution aye - a moviecliploader object is the way in as2 as an aside, if you're loading multiple movies, can you use the same moviecliploader object or should you use different objects? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] getBytesLoaded() and actions execution
Is it safe to assume that as soon as loaded.getBytesLoaded() == loaded.getBytesTotal() actions in first frame of the loaded 'loaded' movieclip were executed ? calculate and use percentage: var l:Number = loaded.getBytesLoaded(); var t:Number = loaded.getBytesTotal(); var p:Number = Math.floor((l/t)*100); if(p == 100) { // loading is done // but loaded clip might not be ready yet } Best is to use MovieClipLoader and its onLoadInit event though. http://livedocs.adobe.com/flash/9.0/main/2001.html regards, Muzak ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] getBytesLoaded() and actions execution
aye - a moviecliploader object is the way in as2 as an aside, if you're loading multiple movies, can you use the same moviecliploader object or should you use different objects? On 9 Feb 2008, at 16:13, Hans Wichman wrote: Hi, no i don't think so, check out moviecliploader. greetz JC On Sat, Feb 9, 2008 at 4:31 PM, strk <[EMAIL PROTECTED]> wrote: Is it safe to assume that as soon as loaded.getBytesLoaded() == loaded.getBytesTotal() actions in first frame of the loaded 'loaded' movieclip were executed ? --strk; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] getBytesLoaded() and actions execution
Hi, no i don't think so, check out moviecliploader. greetz JC On Sat, Feb 9, 2008 at 4:31 PM, strk <[EMAIL PROTECTED]> wrote: > Is it safe to assume that as soon as > loaded.getBytesLoaded() == loaded.getBytesTotal() > actions in first frame of the loaded 'loaded' movieclip > were executed ? > > --strk; > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] getBytesLoaded() and actions execution
strk wrote: Is it safe to assume that as soon as loaded.getBytesLoaded() == loaded.getBytesTotal() actions in first frame of the loaded 'loaded' movieclip were executed ? No. First because even before loading starts, the value will be the same (0 and 0 or some variation). So you have to check for a minimum BytesTotal size (say, 20). Second because even when it's loaded the content might not have initialized yet. So wait for _width > 0. And third because if it's a child movie it is lower on the execution queue. So the code will execute a frame later. All considered, you'd better have some event or variable that tells whether the code was already executed or not, and check against it, instead of just take the byte count into consideration. Zeh ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] getBytesLoaded() and actions execution
Is it safe to assume that as soon as loaded.getBytesLoaded() == loaded.getBytesTotal() actions in first frame of the loaded 'loaded' movieclip were executed ? --strk; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders