flash on 2009-5-14
/**
* Copyright Fricks ( http://wonderfl.net/user/Fricks )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ftsb
*/
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.display.Graphics;
import flash.events.Event;
public class FlashTest extends Sprite {
private var degree:Number = 0;
private var radian:Number = 0;
private var r:Number = 115;
private var cx:Number = 230;
private var cy:Number = 230;
private var col:Number = 0xFF0000;
public function FlashTest() {
// write as3 code here..
init();
}
private function init() {
addEventListener(Event.ENTER_FRAME,upLoad);
}
private function upLoad(e:Event) {
radian = degree/180*Math.PI;
drawCircleFunc(r*Math.cos(radian)+cx,r*Math.sin(radian)+cy);
degree++;
if(degree > 360){
degree = 0;
}
}
private function drawCircleFunc(dcx:Number,dcy:Number){
var shape:Shape = new Shape();
var g = shape.graphics;
g.beginFill (col, 1.0);
g.drawCircle(dcx-1,dcy-1,2);
addChild(shape);
}
}
}