JoJo:
用Flash Builder做星空动画,呵呵。。。
[阅读: 478] 2009-07-16 02:05:33
package com.thinkspace.MoonMark
{
import flash.display.Graphics;
import flash.display.Shape;
internal class Star extends Shape
{
private var size:uint;
private var light:Number;
private var speed:Number;
public function Star(size:uint, light:Number, speed:Number)
{
super();
this.size = size;
this.light = light;
this.speed = speed;
}
public function draw():void{
var g:Graphics = this.graphics;
g.clear();
g.beginFill(0xFFFFFF, light);
g.drawCircle(size/2,size/2,size/2);
g.endFill();
}
public function moveNextStep():void{
this.y += speed;
//this.x += speed * speed * 0.025;
}
public function resetLocation(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
}
}