flash on 2010-9-30
♥0 |
Line 28 |
Modified 2010-09-30 21:42:19 |
MIT License
archived:2017-03-30 04:35:24
ActionScript3 source code
/**
* Copyright bkzen ( http://wonderfl.net/user/bkzen )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ytFr
*/
package {
import flash.text.TextField;
import flash.display.Sprite;
public class FlashTest extends Sprite {
private var test:Test;
public function FlashTest() {
// write as3 code here..
test = new Test(addChild(new TextField()) as TextField);
}
}
}
import flash.events.Event;
import flash.display.Shape;
import flash.text.TextField;
class Test
{
private var txt:TextField;
private var sh:Shape;
function Test(txt:TextField)
{
this.txt = txt;
sh = new Shape();
sh.addEventListener(Event.ENTER_FRAME, loop);
}
private function loop(e: Event): void
{
txt.text = String(sh.mouseX + " : " + sh.mouseY);
}
}