|
From: Raymond S. <dst...@or...> - 2000-12-31 12:18:54
|
If you generated a path with a (-) negative number in setAngleIncrement
method (to allow you to determine direction, clockwise(-) or counter
clockwise(+) it would freeze up during this line "for (var
a=this.angle;a<=this.angle+Math.PI*2;a+=this.angleinc) {" in the
generatePath method of circle.js. This method is critical because it allows
you to inherit both 'loop' and 'reset' functionality from pathanim.js and
have some real fun. Now you setAngleIncrement as a positive for speed and
use setDirection (+ or - 1) to set path direction. Tested in both IE and NS
on WinME.
added/changed the following lines. Full js file attached.
____________________________________________________________________________
____________
this.direction = 1
CircleAnimation.prototype.setDirection = function (d) {
this.direction = d;
CircleAnimation.prototype.generatePath = function(centerX,centerY) {
if (centerX==null) centerX = this.dlyr!=null? this.dlyr.x : 0;
if (centerY==null) centerY = this.dlyr!=null? this.dlyr.y : 0;
var path = [];
var i = 0;
for (var a=this.angle;a<=this.angle+Math.PI*2;a+=this.angleinc) {
path[i] = Math.round(centerX + this.hradius*Math.cos(this.direction*a));
path[i+1] = Math.round(centerY - this.vradius*Math.sin(this.direction*a));
i+=2;
}
return path;
};
____________________________________________________________________________
____________
cheers,
Ray
|