flash - how to draw a 'circle' with 'dynamic angle' using action script 2? -
i want have circle (maybe movieclip ) show timer change picture :
and need access angle in run-time. example:
function setangle(degree:number)
any suggest ?
give try:
var circle:number = math.pi * 2; var degree:number = math.pi / 180; var radius:number = 30; var shape:movieclip = _root.createemptymovieclip("shape", _root.getnexthighestdepth()); shape._x = 100; shape._y = 100; shape._rotation = -90; function render(chunkangle:number):void { chunkangle *= degree; shape.clear(); shape.linestyle(1); shape.beginfill(0x6bb0ff); shape.lineto(radius, 0); for(var i:number = circle; > chunkangle; -= degree) { shape.lineto(math.cos(i) * radius, math.sin(i) * radius); } shape.lineto(0, 0); shape.endfill(); } render(45);
Comments
Post a Comment