Hi, why doesn’t this line work?
_root.removeMovieClip(“preloader”)
The preloader won’t go away when it’s complete.
[AS]
_root.createEmptyMovieClip(“preloader”, 100);
_global.pl = _root.preloader;
function doPreload(mc) {
if (mc.thisLoaded != true) {
Bl = mc.getBytesLoaded();
Bt = mc.getBytesTotal();
mc.percentDone = Math.round((Bl/Bt)*100);
plFld.text = mc.percentDone+pl.loadedTxt;
_global.plB._xscale = mc.percentDone;
if (Bl == Bt && Bt>8) {
clearInterval(_root.pl_int);
_root.removeMovieClip(“preloader”);
mc.thisLoaded = true;
_root.doWhenLoaded(mc);
}
updateAfterEvent();
}
}
function doWhenLoaded(mc) {
mc.gotoAndStop(“init”);
}
//| syntax:
//| preload(preloader._x, preloader._y, progressBar color, status text color);
//| or
//| preload();
MovieClip.prototype.preload = function(X, Y, W, H, Boffset, Bcol, Tcol) {
_root.preloader.removeMovieClip;
_root.createEmptyMovieClip(“preloader”, 100);
// setting defaults when unspecified
pl.loadedTxt = “% Loaded”;
W = (W == undefined) ? 100 : W;
H = (H == undefined) ? 5 : H;
X = (X == undefined || X == “center”) ? Stage.width/2-W/2 : X;
Y = (Y == undefined || Y == “center”) ? Stage.height/2-H/2 : Y;
Boffset = (Boffset == undefined) ? 0 : Boffset;
Bcol = (Bcol == undefined) ? 0x999999 : Bcol;
Tcol = (Tcol == undefined) ? 0x999999 : Tcol;
// end setting defaults
pl._x = X;
pl._y = Y;
// create the background for progressBar
pl.beginFill(Bcol, 50);
pl.moveTo(-Boffset, -Boffset);
pl.lineTo(W+Boffset, -Boffset);
pl.lineTo(W+Boffset, H+Boffset);
pl.lineTo(-Boffset, H+Boffset);
pl.lineTo(-Boffset, -Boffset);
pl.endFill();
//| setup the progress bar
pl.createEmptyMovieClip(“progressBar”, 1);
_global.plB = pl.progressBar;
plB.beginFill(Bcol, 50);
plB.moveTo(0, 0);
plB.lineTo(W, 0);
plB.lineTo(W, H);
plB.lineTo(0, H);
plB.lineTo(0, 0);
plB.endFill();
plB._xscale = 1;
//|setup the load status textFormat
_global.plFt = new textFormat();
plFt.font = “Verdana, Helvetica, Arial, _sans”;
plFt.size = 9;
//|setup the load status textField
pl.createTextField(“loadStatus_txt”, 2, 1, 12-Boffset, 100, 100);
_global.plFld = _level0.preloader.loadStatus_txt;
plFld.autoSize = true;
plFld.background = false;
plFld.selectable = false;
plFld.border = false;
plFld.textColor = Tcol;
plFld.text = “0”+pl.loadedTxt;
plFld.setNewTextFormat(plFt);
plFld._y -= (plFld.textHeight);
_root.pl_int = setInterval(doPreload, 1, this);
};
// preload this movie
stop();
preload(); // status bar is on middle of Stage
// or specify
//preload(this._x+10, this._y+10, 200, 2, 2, 0x990000, 0x990000);
preload(undefined, undefined, 170, 16, 0, 0xDCDCDC, 0xFFFFFF);
nextScene();
[/AS]