Hello Omar,
possible... it's very old example.
try at this:
function drawSegment(target, rx, ry, x, y, sgm, s1, s2) {
var rad = Math.PI/180;
if (!s1 and !s2 or s1 == s2) {
var grad = 360;
var segm = grad/sgm;
var x1 = rx+x;
var y1 = y;
target.moveTo(x1, y1);
} else {
s1>s2 ? s1 -= 360 : "";
var x1 = rx*Math.cos(s1*rad)+x;
var y1 = ry*Math.sin(s1*rad)+y;
var grad = s2-s1;
var segm = grad/sgm;
target.moveTo(x, y);
target.lineTo(x1, y1);
}
for (var s = segm+s1; s<(grad+.1+s1); s += segm) {
var x2 = rx*Math.cos((s-segm/2)*rad)+x;
var y2 = ry*Math.sin((s-segm/2)*rad)+y;
var x3 = rx*Math.cos(s*rad)+x;
var y3 = ry*Math.sin(s*rad)+y;
// begin tnx 2 Robert Penner
var cx = 2*x2-.5*(x1+x3);
var cy = 2*y2-.5*(y1+y3);
target.curveTo(cx, cy, x3, y3);
// end tnx 2 Robert Penner :)
x1 = x3;
y1 = y3;
}
if (grad != 360) {
target.lineTo(x, y);
}
};
_root.onEnterFrame = function() {
_root.clear();
_root.lineStyle(0);
_root.beginFill(0xFF0000);
a= a||0
b=b||0
a>=360 ? a -= 360 : a += 2;
b>=360 ? b -= 360 : b += 3;
drawSegment(_root, 150, 100, 200, 250, 8, a, b);
_root.endFill();
_root.lineStyle(0);
_root.beginFill(0xFF00FF);
drawSegment(_root, 150, 100, 200, 200, 8, a, b);
_root.endFill();
};
--
iv
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com