i’m using the script that i modified from sbeener’s pie preloader.
here’s the code i have
MovieClip.prototype.drawMeter = function(t,l){
var p = l/t;
var r = 16;
var v = [[r,-r],[r,r],[-r,r],[-r,-r]];
var d = Math.ceil(p*4);
var s = this.getProgress(p);
with(this){
clear();
beginFill(0x560000);
lineTo(0,-r);
for(var i=0;i < d;i++){
lineTo(v*[0],v*[1]);
}
lineTo(s.x,s.y);
endFill();
// in drawMeter()
if(t == l){
// when loaded actions
_root.nextFrame();
}
}
}
MovieClip.prototype.getProgress = function(p){
var r = 20;
var s = Math.PI + (-p * Math.PI*2);
return({y:Math.cos(s)*r,x:Math.sin(s)*r});
}
MovieClip.prototype.drawCircle = function(r, x, y){
this.moveTo(x+r, y);
this.curveTo(r+x, -0.4142*r+y, 0.7071*r+x, -0.7071*r+y);
this.curveTo(0.4142*r+x, -r+y, x, -r+y);
this.curveTo(-0.4142*r+x, -r+y, -0.7071*r+x, -0.7071*r+y);
this.curveTo(-r+x, -0.4142*r+y, -r+x, y);
this.curveTo(-r+x, 0.4142*r+y, -0.7071*r+x, 0.7071*r+y);
this.curveTo(-0.4142*r+x, r+y, x, r+y);
this.curveTo(0.4142*r+x, r+y, 0.7071*r+x, 0.7071*r+y);
this.curveTo(r+x, 0.4142*r+y, r+x, y);
}
this.createEmptyMovieClip("loader",0);
this.createEmptyMovieClip("mask",1);
this.mask.beginFill(0xfeefff);
this.mask.drawCircle(16,0,0);
this.mask.endFill();
this.loader.setMask(this.mask);
loader.onEnterFrame = function(){
if((i++) < 100){
this.drawMeter(100,i);
}
}
this.preloader_mc.loadedFile.onEnterFrame = "The movie is " + p + "% loaded";
here is my question. the last line of the code defines what the textbox contained inside a clip called preloader_mc with a variable of loadedFile should display the percentage loaded of the file according to the variable p set at the beginning of this code
why doesn’t this work?
by the way sbeener, it wasn’t working b/c i did miss one of the _roots … it was acting funny b/c the mask was being put on the _root still so it had nothing to mask since the meter was inside the symbol instance i made. now it works fine though well except for the text thing i’m trying to do now