Groups | Blog | Home
all groups > flash actionscript > october 2006 >

flash actionscript : preloader and preloads


gdmt
10/21/2006 1:40:37 PM
hi there!
i'd like to know how to make a preloader like this, wich preloads sound and
images separately...

http://www.fatwreck.com/media/ecard?id=91&bandsubmit.x=16&bandsubmit.y=14

and i'd like to know if there is a way to preload external swfs while the main
movie is preloading or being navigated


thanx a lot in advance!
kglad
10/21/2006 2:59:06 PM
preloading more than one group of files is no more difficult than preloading
one group of files whether the groups are a combination of images, sounds, xml
files or swfs (including the main swf).

the essential step to preload one group is to execute a for-loop that sums the
getBytesTotal() of the group. you can then display the load progress of the
group against this total.
gdmt
10/23/2006 2:47:31 AM
uhm, thanx 4 reply kglad...
CoDo
10/23/2006 10:30:02 AM
Hi kglad,

Could you expand your example to the max so that a newbe could follow
(reproduce) it??

TIA,
Cor
kglad
10/23/2006 2:42:35 PM
actually, if you have a lot of files to group you may hit a limit for
simultaneous downloads (set by your browser/os) and using a for-loop won't work.

if all your external files that you want to group are in swfA you can use a
dummy targetMC to calculate the total bytes of the files in swfA using:



index = 0;
totalBytes = 0;
targetMC.loadMovie(swfA[index]);
getTotalI = setInterval(getTotalF, 100);
function getTotalF() {
if (targetMC.getBytesTotal()>0) {
totalBytes += targetMC.getBytesTotal();
index++;
if (index<swfA.length) {
targetMC.loadMovie(swfA[index]);
} else {
clearInterval(getTotalI);
}
}
}
gdmt
10/24/2006 12:00:00 AM
oh, thanx 4 the AS!

i'm pretty busy these days, but i'll check it...

kglad
10/24/2006 2:32:54 PM
AddThis Social Bookmark Button