Math.sin(Math.PI)
It's a circular pre-loader. When I add the "SecondHalf" the preloader doesn't work and gives an error saying the script is causing the flash player to run slowly. How can I fix this?
This code is in: _root.first_mc._second_mc
previewImage.onLoadProgress = function(targetMC, lBytes, tBytes) {
//FirstHalf
//This works only without "SecondHalf"
percentDone=Math.round((lBytes / tBytes) * 100);
_root.loaderPsnt_tx.percentDisplay.text = percentDone + "%";
//SecondHalf
//This is not working
_root.mc_mask.clear();
_root.mc_mask.beginFill(0xff0000, 100);
_root.mc_mask.lineStyle(1, 0xff0000, 80);
for (i=0; i>=c; i--) {
x = Math.sin(Math.PI/90*i)*mask_ra;
y = Math.cos(Math.PI/90*i)*mask_ra;
_root.mc_mask.lineTo(x, y);
}
_root.mc_mask.endFill();
c = Math.round(percentDone * (-1.84));
};
previewImage.onLoadStart = function(targetMC) {
_root.loaderPsnt_tx._visible = _root.circle._visible = _root.mc_mask._visible = true;
_root.circle.setMask(_root.mc_mask);
var mask_ra:Number = (_root.circle._width / 1) * -1;
var c:Number = 0;
var percentDone:Number = 0;
};
previewImage.onLoadComplete = function(targetMC) {
_root.loaderPsnt_tx._visible = _root.circle._visible = _root.mc_mask._visible = false;
};