Math.sin(Math.PI)
it's circular pre-loader. when add "secondhalf" preloader doesn't work , gives error saying script causing flash player run slowly. how can fix this?
this code in: _root.first_mc._second_mc
previewimage.onloadprogress = function(targetmc, lbytes, tbytes) {
//firsthalf
//this works without "secondhalf"
percentdone=math.round((lbytes / tbytes) * 100);
_root.loaderpsnt_tx.percentdisplay.text = percentdone + "%";
//secondhalf
//this not working
_root.mc_mask.clear();
_root.mc_mask.beginfill(0xff0000, 100);
_root.mc_mask.linestyle(1, 0xff0000, 80);
(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;
};
c isn't defined when loadprogress first executes.
try:
previewimage.onloadprogress = function(targetmc, lbytes, tbytes) {
//firsthalf
//this works without "secondhalf"
percentdone=math.round((lbytes / tbytes) * 100);
_root.loaderpsnt_tx.percentdisplay.text = percentdone + "%";
//secondhalf
//this not working
_root.mc_mask.clear();
_root.mc_mask.beginfill(0xff0000, 100);
_root.mc_mask.linestyle(1, 0xff0000, 80);
c = math.round(percentdone * (-1.84));
(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();
};
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;
};
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment