flash on 2015-7-9
♥0 |
Line 77 |
Modified 2015-07-09 04:06:30 |
MIT License
archived:2017-03-30 11:45:35
ActionScript3 source code
/**
* Copyright mutantleg ( http://wonderfl.net/user/mutantleg )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/AmyH
*/
package {
import flash.events.Event;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
stage.addEventListener(Event.ENTER_FRAME, onEnter);
}//ctor
public var ang:Number= 0;
public function onEnter(e:Event):void
{
graphics.clear();
graphics.lineStyle(2, 0);
var r:Number;
var ax:Number; var ay:Number;
ax=230; ay =230; r=128;
graphics.drawCircle(ax,ay, r);
ang += 0.1;
var kx:Number; var ky:Number;
var ca:Number; var sa:Number; var ta:Number;
ta=ang; ta*=0.3;
kx = ax+Math.cos(ta)*r;
ky = ay+Math.sin(ta)*r;
graphics.drawCircle(kx,ky, 16);
ta = ang; ca=Math.cos(ta); sa= Math.sin(ta);
if (sa>0){sa=0;}
kx = ax+ca*r; ky = ay+sa*r;
graphics.drawCircle(kx,ky, 14);
ta = ang; ta +=3.4;
ca=Math.cos(ta); sa= Math.sin(ta);
if (sa>0){sa*=0.1;} else {sa*=0.5;}
kx = ax+ca*r; ky = ay+sa*r;
graphics.drawCircle(kx,ky, 12);
ta=ang; ta*=0.23;
kx = ax+Math.sin(ta)*r;
ky = ay+Math.cos(ta)*r;
graphics.drawCircle(kx,ky, 10);
ta=ang; ta*=0.33;
kx = ax+Math.sin(ta)*r;
ky = ay+Math.sin(ta)*r;
graphics.drawCircle(kx,ky, 8);
ta=ang; ta*=0.45;
kx = ax+Math.cos(ta)*r;
ky = ay+Math.cos(ta)*-r;
graphics.drawCircle(kx,ky, 6);
graphics.lineStyle(2, 0xFF);
ta=ang; ta*=0.53;
kx = ax+Math.sin(ta)*Math.cos(ta)*r;
ky = ay+Math.cos(ta)*r;
graphics.drawCircle(kx,ky, 15);
ta=ang; ta*=0.63;
kx = ax+Math.sin(ta)*r;
ky = ay+Math.cos(ta)*Math.sin(ta)*r;
graphics.drawCircle(kx,ky, 13);
ta=Math.sin(ang);
kx = ax+Math.sin(ta)*r;
ky = ay+Math.cos(ta)*r;
graphics.drawCircle(kx,ky, 11);
ta=Math.cos(ang);
kx = ax+Math.sin(ta)*r;
ky = ay+Math.cos(ta)*r;
graphics.drawCircle(kx,ky, 9);
ta=Math.sin(ang);
kx = ax+Math.sin(ta)*Math.cos(ta)*r;
ky = ay+Math.cos(ta)*r;
graphics.drawCircle(kx,ky, 7);
graphics.lineStyle(2, 0xFF0000);
ta=ang; ta*=0.53;
kx = ax+Math.sin(ta)*Math.cos(ta)*r;
ky = ay+Math.cos(ta)*Math.sin(ta)*r;
graphics.drawCircle(kx,ky, 15);
ta=ang; ta*=0.73;
kx = ax+Math.sin(ta)*Math.sin(ta)*r;
ky = ay+Math.cos(ta)*Math.cos(ta)*r;
graphics.drawCircle(kx,ky, 13);
}//onenter
}//classend
}