Preloader across multiple _levels?

Im trying to create a preloader that calculates total bytes across all loaded movies. Does anyone have any links to a good tutorial or source FLA on the matter? Or look below and give a hint or two.


Im doing something like this:

one frame 1:

onClipEvent (load) {
&nbsp &nbsp &nbsp &nbsp loadMovieNum(“home.swf”, 1);
&nbsp &nbsp &nbsp &nbsp loadMovieNum(“profile.swf”, 2);
&nbsp &nbsp &nbsp &nbsp loadMovieNum(“navigation.swf”, 20);

on frame 2:

onClipEvent (enterFrame) {
&nbsp &nbsp &nbsp &nbsp totalBytes = _level1.getBytesTotal()+_level2.getBytesTotal+_level20.getBytesTotal();
&nbsp &nbsp &nbsp &nbsp bytesLoaded = _level1.getBytesLoaded()+_level2.getBytesLoaded+_level20.getBytesLoaded();
&nbsp &nbsp &nbsp &nbsp percentLoaded = Math.floor
if (percentLoaded>0 && percentLoaded<100) {
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp _root.text=percentLoaded+" %";
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp _root.loadingbar.gotoAndStop(percentLoaded);
&nbsp &nbsp &nbsp &nbsp }

&nbsp &nbsp &nbsp &nbsp if ((totalBytes>100) && (percentLoaded >= 100)) {
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp _root.gotoAndPlay(“loaded”);
&nbsp &nbsp &nbsp &nbsp }