flash on 2012-3-10
♥0 |
Line 23 |
Modified 2012-03-10 17:28:43 |
MIT License
archived:2017-03-30 07:57:52
ActionScript3 source code
/**
* Copyright umhr ( http://wonderfl.net/user/umhr )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/qbwE
*/
package {
import flash.display.Sprite;
import flash.events.Event;
public class FlashTest extends Sprite {
private var circle:Sprite = new Sprite();
public function FlashTest() {
// write as3 code here..
circle.graphics.beginFill(0xFF0000);
circle.graphics.drawCircle(0,100,40);
this.addChild(circle);
this.addEventListener(Event.ENTER_FRAME,onEnter);
}
private function onEnter(e:Event):void{
circle.x += 2;
circle.y += 1;
if(circle.x > 400){
circle.x = 0;
}
if(circle.y > 400){
circle.y = 0;
}
}
}
}