Math#cos
♥0 |
Line 22 |
Modified 2011-07-14 18:30:23 |
MIT License
archived:2017-03-20 16:11:39
ActionScript3 source code
/**
* Copyright itkr ( http://wonderfl.net/user/itkr )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/g5Sp
*/
package {
import flash.events.Event;
import flash.display.Sprite;
public class Main extends Sprite{
private var count:int = 0;
public function Main(){
addEventListener(Event.ENTER_FRAME, foo);
}
private function foo(e:Event):void{
count += Math.PI*2;
var g:Sprite = new Sprite();
g.graphics.beginFill(0x000000);
g.graphics.drawCircle(0, 0, 5);
g.y = Math.cos(count) * 100 + 230;
g.x = count;
addChild(g);
if(count>460){
removeEventListener(Event.ENTER_FRAME, foo);
}
}
}
}