flash on 2011-7-4
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
{
public function Main()
{
draw(0, 0, 150);
this.x = this.y = stage.stageWidth / 2;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(e:Event):void
{
rotation += 3;
}
private function draw(x:Number, y:Number, radius:Number):void
{
var mask_:Shape = new Shape();
mask_.graphics.beginFill(0x0);
mask_.graphics.lineStyle(2.0);
mask_.graphics.drawCircle(x, y, radius);
mask_.graphics.lineStyle();
addChild(this.mask = mask_);
graphics.beginFill(0x0);
graphics.drawRect(x, y - radius, radius, radius * 2);
graphics.endFill();
graphics.beginFill(0xFFFFFF);
graphics.drawCircle(x, y - radius / 2, radius / 2);
graphics.endFill();
graphics.beginFill(0x0);
graphics.drawCircle(x, y + radius / 2, radius / 2);
graphics.endFill();
graphics.beginFill(0xFFFFFF);
graphics.drawCircle(x, y + radius / 2, radius / 6);
graphics.endFill();
graphics.beginFill(0x0);
graphics.drawCircle(x, y - radius / 2, radius / 6);
graphics.endFill();
graphics.lineStyle(4.0);
graphics.drawCircle(x, y, radius);
graphics.lineStyle();
}
}
}