I'm making an animation and I needed a preloader, so I took a newgrounds preloader template and did some heavy modifying to it. So instead of just a static movieclip for a loading bar, I've got an animated movieclip for a loading bar. I want it so that when, say, the movie is at 50%, the movieclip will be at frame 50, 75% at frame 75 and so on. But I'm very new to action script, and I'm having trouble editing the code. The movieclip just loops until the movie is fully loaded.
Here's the code I'm using:
Suggestions, anyone?PHP Code:_root.stop();
stop();
var AUTO_PLAY = false;
var loadingComplete = false;
timerHandler();
function timerHandler()
{
if(!loadingComplete)
{
var loaded = _root.getBytesLoaded() / _root.getBytesTotal();
bar.gotoAndStop(loaded * 100);
if(loaded == 1)
{
loadingComplete = true;
if(AUTO_PLAY)
startMovie();
else
gotoAndStop("loaded");
return;
}
}
}
function startMovie()
{
_root.play();
}
