flash on 2010-2-4
♥0 |
Line 32 |
Modified 2010-02-04 00:24:07 |
MIT License
archived:2017-03-20 00:42:05
ActionScript3 source code
/**
* Copyright 084 ( http://wonderfl.net/user/084 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/1mTC
*/
package {
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite {
private var square:Sprite;
private var angle:Number = 0;
public function Main():void {
square= new Sprite();
with (square.graphics) {
lineStyle(1, 0, 1);
beginFill(0xdcdcdc);
moveTo(0,-5);
lineTo(0,5);
moveTo(-5,0);
lineTo(5,0);
moveTo(0-50, 0-50);
lineTo(100-50, 0-50);
lineTo(100-50, 100-50);
lineTo(0-50, 100-50);
endFill();
}
square.x = stage.stageWidth/2
square.y = stage.stageHeight/2
this.addChild(square);
square.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(event:Event):void {
square.y = stage.stageHeight / 2 + Math.sin(angle) * 80;
angle += .1;
}
}
}