Click to See Complete Forum and Search --> : preloader
simpelendidi
12-27-2002, 11:37 AM
Can someone help me with this actionscript for a preloader ?
tmoore935
12-27-2002, 03:31 PM
Wht not use the koolmoves already built in preloader?
movie>>loading message?
Bob Hartzell
12-27-2002, 04:22 PM
Remus is the preloader expert. When he returns from vacation, he can figure it out.
simpelendidi
12-27-2002, 04:37 PM
Thanks Bob, can you notify me when he's back.
bridelh
12-28-2002, 08:41 AM
Take a look at this site for some guidance:
http://www.bokelberg.de/actionscript/
Hilary
--
johnie
12-30-2002, 04:48 AM
Preloaders are pretty simple. All you need to do is compare either the framesloaded to the totalframes or you can use the getbytesloaded and compare it to totalbytes.
Either one is aceptable.
The trick is to not use frame 0. You can also use it to check a loaded movie- loaded into a level or movie clip.
Anyhow the way to do it is this;
On your second or third frame, make sure its after your preloader. You will add this script to the frame.
total= _root._totalframes;
loaded=_root._framesloaded;
if(loaded != total)
{
GotoandPlay(0);
}
you could switch this by comparing bytes if you wish by replacing _totalframes and _framesloaded getbytestotal() and getbytesloaded().
johnie
12-30-2002, 05:06 AM
Okay, I looked at your file. It has some serious problems.
One of them is that in your MC you have tweens set to 6 instead of to 0. This means that key frame 2 is actaully frame 6 and key frame 3 is actually 12.
Second on key frame 16 your AS is
vavar total = _root.getBytesTotal ();
var loaded = _root.getBytesLoaded ();
var procent = (100/total)*loaded ;
if (procent >= 100) {
_root.gotoAndPlay ("main");
}
Notice that you mistyped var ** Note ** you do not need to type var when declaring a local variable but rather just the name of it. Varvar is the name of the variable as it is not restricyed. fix the typo.
Set the tweens to 0 and fix your typo and it works.
I wouldn't have constructed it like this though- There is an easier way to acomplish this.
simpelendidi
12-30-2002, 05:48 AM
Thanks for the help.
Now I can also animate the loading part and
tell how much there is to load of the total.
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.