i am trying to do an AS only preloader, but i have the following problems:
[list]
[]the text won’t format properly
[]it won’t go to the next frame in _root when it’s finished.
[/list]anyone? here is the code so far [ copy/paste in an empty movieclip ]:
_root.stop();
onEnterFrame = function () {
preloader._width = (_root.getBytesLoaded()/_root.getBytesTotal())*200;
statusTxt.status.text = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";
statusTxt._x = preloader._width;
if (_root.getBytesLoaded == _root.getBytesTotal()) {
trace("loadDone");
_root.gotoAndStop(2);
}
};
createEmptyMovieClip("box", 1);
with (box) {
lineStyle(0, 0xffffff);
moveTo(-5, -5);
lineTo(205, -5);
lineTo(205, 15);
lineTo(-5, 15);
lineTo(-5, -5);
trace("box done");
}
createEmptyMovieClip("statusTxt", 2);
with (statusTxt) {
createTextField("status", _root.getNextHighestDepth(), -20, -5, 100, 100);
with (status) {
statusFormat = new TextFormat();
with (statusFormat) {
color = 0xffffff;
underline = true;
}
setTextFormat(statusFormat);
trace("statusDone");
}
}
createEmptyMovieClip("preloader", _root.getNextHighestDepth());
with (preloader) {
createEmptyMovieClip("fill", _root.getNextHighestDepth());
with (fill) {
lineStyle(0, 0x1d3f43, 0);
beginFill(0x1d3f43, 100);
moveTo(0, 0);
lineTo(200, 0);
lineTo(200, 10);
lineTo(0, 10);
lineTo(0, 0);
endFill();
trace("fillDone");
}
}