Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.display.Sprite;
- import fl.transitions.Tween;
- import fl.transitions.easing.*;
- var box:Sprite = new Sprite();
- box.graphics.beginFill(0xABCDEF);
- box.graphics.drawCircle(0, 0, 10);
- box.graphics.endFill();
- this.addChild(box);
- var tweenX:Tween;
- var tweenY:Tween;
- function moveBox(){
- tweenX = new Tween(box, "x", Strong.easeOut, box.x, getRand(0, stage.stageWidth), 3, true);
- tweenY = new Tween(box, "y", Strong.easeOut, box.y, getRand(0, stage.stageHeight), 3, true);
- }
- function getRand(min:Number, max:Number){
- return Math.round(Math.random()*(max-min))+min;
- }
- var timer:Number = setInterval(moveBox, 2500);
Add Comment
Please, Sign In to add comment