/**
* Copyright mutantleg ( http://wonderfl.net/user/mutantleg )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ImDI
*/
package {
import flash.display.Graphics;
import flash.display.Shape;
import flash.events.Event;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
graphics.clear();
graphics.lineStyle(2, 0);
var ta:Number;
var ax:Number; var ay:Number;
var i:int;
var ms:Number;
var w:int; w = 0;
ms = 8;
ta =0;
ax= 230; ay = 230-230;
for (i=0;i<120;i+=1)
{
ax += Math.cos(ta) * ms;
ay += Math.sin(ta) * ms;
if(w == 0) {ta += 3.14 / 32;
if (ta>=3.14) { w = 1;} }
if (w==1) { ta -= 3.14/32;
if (ta<=0) { w = 2;}
}
if (w>=2 ) { ta = 0; w+=1;
if (w>=16) {w =0; } }
// graphics.drawCircle(ax,ay, 4);
if (i==0) {graphics.moveTo(ax,ay); }
graphics.lineTo(ax,ay);
}//nexti
tempShape = new Shape();
addChild(tempShape);
stage.addEventListener(Event.ENTER_FRAME, onEnter);
}//ctor
public var ang:Number = 0;
public var cx:Number = 230;
public var cy:Number =0;
public var md:int =0;
public var tempShape:Shape;
public function onEnter(e:Event):void
{
var g:Graphics;
g = tempShape.graphics;
g.clear();
g.beginFill(0,1);
g.drawCircle(cx,cy,16);
g.endFill();
g.beginFill(0,1);
g.drawCircle(cx+Math.cos(ang)*12,cy+Math.sin(ang)*12,12);
g.endFill();
var ms:Number;
ms = 8;
ms=4;
cx += Math.cos(ang) * ms;
cy += Math.sin(ang) * ms;
if(md == 0) {ang += 3.14 / 64;
if (ang>=3.14) { md = 1;} }
if (md==1) { ang -= 3.14 / 64;
if (ang<=0) { md = 2;}
}
if (md>=2 ) { ang = 0; md+=1;
if (md>=30) {md =0; } }
if (cy>= 465) { md=0;cx=230;cy=0; ang = 0; }
}//onenter
}//classend
}