flash on 2011-4-23
/**
* Copyright yuugurenote ( http://wonderfl.net/user/yuugurenote )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/eu7c
*/
package {
import flash.display.Sprite;
import flash.events.Event;
public class FlashTest extends Sprite {
var mySprite:Sprite = new Sprite();
public function FlashTest() {
// write as3 code here..
mySprite.graphics.beginFill(0xC1F1F1F,1);
mySprite.graphics.drawRect(0,0,10,10);
mySprite.graphics.beginFill();
addChild(mySprite);
mySprite.addEventListener(Event.ENTER_FRAME,xEnter);
function xEnter(e:Event):void {
mySprite.x += (mouseX - mySprite.x)/8;
mySprite.y += (mouseY - mySprite.y)/8;
}
}
}
}