();
if ( Math.abs(degree) > 360 ) degree %= 360;
var div:int = Math.ceil( degree / 30 );
var radians:Number = degree * Math.PI / 180;
var offsetRadians:Number = offsetDegree * Math.PI / 180;
var segment:Number = radians / div;
var _from:Number;
var _to:Number;
for(var i:int;i 0){
var arc:Object = objectArc(radius, degree, offsetDegree);
if( innerRadius == 0 ){
arc.commands.push(GraphicsPathCommand.LINE_TO);
arc.data.push(0,0);
g.drawPath(arc.commands, arc.data);
} else {
var oppositeArc:Object = objectArc(innerRadius, degree, offsetDegree, true);
var offsetRadians:Number = offsetDegree * Math.PI / 180;
var x0:Number = Math.cos( offsetRadians ) * innerRadius;
var y0:Number = Math.sin( offsetRadians ) * innerRadius;
g.moveTo( x0, y0);
g.drawPath(arc.commands, arc.data);
g.drawPath(oppositeArc.commands, oppositeArc.data);
}
}
}
/**
* HSVをRGBに変換
*/
public function HSVtoRGB( h:Number, s:Number, v:Number ):uint{
var r:Number, g:Number, b:Number;
if( s != 0 ){
h %= 360;
var hi:uint = h / 60 % 6;
var f:Number = h / 60 - hi;
var p:Number = v * ( 1 - s );
var q:Number = v * ( 1 - f * s );
var t:Number = v * ( 1 - ( 1 - f ) * s );
switch( hi ){
case 0: r = v; g = t; b = p; break;
case 1: r = q; g = v; b = p; break;
case 2: r = p; g = v; b = t; break;
case 3: r = p; g = q; b = v; break;
case 4: r = t; g = p; b = v; break;
case 5: r = v; g = p; b = q; break;
}
} else r = g = b = v;
return ( 0xFF * r << 16 ) + ( 0xFF * g << 8 ) + ( 0xFF * b );
}
}
import flash.display.Sprite;
import flash.events.Event;
class MovingPoint extends Sprite{
public var vx:Number;
public var vy:Number;
public function MovingPoint( vx:Number, vy:Number ){
this.vx = vx;
this.vy = vy;
addEventListener( Event.ENTER_FRAME, enterFrame );
}
private function enterFrame( event:Event ):void{
x += vx;
y += vy;
}
}