Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
bokel 's preloader

bokel 's preloader

2004-02-20       - By Susan McDonough

 Back
Not sure if this will work....
I am trying to use Bokel's preloader to load5jpgs at the beginning of the
movie. Later do I access them as "actMovieIdx1" etc... Thanks, Susan McD

frame 1:
//provide a list with all your movies to load and the targets/levels to load
into
moviearray = new
Array("jewel1.jpg","jewel2.jpg","jewel3.jpg","jewel4.jpg","jewel5.jpg","
_level99");
//set the index of the first movie to load
actMovieIdx = 0;


frame 2:
// get the next moviename and target/level
moviename = moviearray[actMovieIdx++];
movietarget = moviearray[actMovieIdx++];

// load the given movie
loadMovie(moviename, movietarget);

// remember the time where we started loading to calculate the bytes per
second
starttime = getTimer();


frame 3:
//get the actual loaded bytes
actBytes = eval(movietarget).getBytesLoaded() || 0;
// get the total bytes to load
totBytes = eval(movietarget).getBytesTotal() || 100;
// calculate the percentage loaded
percent  = Math.round(actBytes * 100 / totBytes);
// calculate bytes per second loaded
bps = Math.floor(actBytes * 1000 / (getTimer() - starttime));

frame 4:

if( totBytes - actBytes > 10){//more bytes available, keep on loading
  gotoAndPlay(3);
} else if(actMovieIdx < moviearray.length){//if we got more movies to load
  gotoAndPlay(2);
}

frame 5:
// ready, go - here starts your movie

__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin
.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your
skill set with courses in ColdFusion, Flash, Rich Internet
Applications and .NET in the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington  
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at
your location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected)
For additional commands, e-mail: flashnewbie-help@(protected)