PDA

View Full Version : Preloader question


SteveC
08-02-2001, 11:21 AM
Hi guys,

I've got a 1200 frame movie and want a progress bar at the beginning to scale according the the number or frames that have been loaded - then play the movie which starts frame 2.

The bar is an instanced movie clip called 'loader' and the actionscript is on the main timeline, frame 1, as follows -

if (_framesloaded>=_totalframes) {
gotoAndPlay (2);
} else {
setProperty ("_root.loader", _xscale, (_framesloaded/_totalframes)*100);
gotoAndPlay (1);
}

It's a modification of the code in the Flash Help. When I view the movie streaming it ignores this frame and streams as normal. Whereas I want it to load all 1200 frames then play.

Any suggestions?

Thanx,

- Steve.

SteveC
08-02-2001, 11:29 AM
Just noticed the pre-loader Tutorial... this might help.

Sorry for wasting your time!
I'll be back if this doesn't work :-)

anjelika
08-06-2001, 02:14 PM
Make sure you put the "stop" action in the Movie clip ("loader") at the first frame.
If it won't work I'll give you a site that has a great preloader tutorial with everything (Total bytes, percentage...)

http://www.anjelika.de.vu

geak
08-07-2001, 02:28 PM
The easiest (and in my experience best) way to do a loading bar is to place the AS in the Loading bar MC clip such as this. The code is some what modular so you can use it for swfs loaded into targets and the like. Make sure that your loading scene has only one frame with no stops.


onClipEvent (load) {
total = _parent.getBytesTotal();
_level0.loadingbar.bar._xscale = 0;
}
onClipEvent (enterFrame) {
loaded = _parent.getBytesLoaded();
percent = (loaded/total*100);
_level0.loadingbar.bar._xscale = percent;
if (_root.getBytesLoaded == _root.getBytesTotal) {
gotoAndPlay (3);
}

}


see ya!:)