fun with circular motion
/**
* Copyright attunedesigns ( http://wonderfl.net/user/attunedesigns )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/lxlm
*/
package {
import flash.display.Sprite;
import flash.events.*;
import flash.filters.*;
[SWF(backgroundColor="#FFFFFF", frameRate=60)]
public class FlashTest extends Sprite {
public var a:Sprite;
public var xangle:Number;
public var yangle:Number;
public var xspeed:Number;
public var yspeed:Number;
public var xradius:Number;
public var yradius:Number;
public function FlashTest() {
a=new Sprite();
a.graphics.beginFill(0);
a.graphics.drawCircle(0,0,70);
addChild(a);
addEventListener(Event.ENTER_FRAME,enterframe);
xangle=0;
yangle=0;
xspeed=.1;
yspeed=.03;
xradius=70;
yradius=85;
}
public function enterframe(e:Event):void{
xangle+=xspeed;
yangle+=yspeed;
a.x=230+Math.cos(xangle)*xradius;
a.y=230+Math.sin(yangle)*yradius;
//a.rotationY=yangle*10;
a.rotationX=(xangle*10)%360;
}
}
}