flash on 2009-7-9
♥0 |
Line 28 |
Modified 2009-07-09 17:53:34 |
MIT License
archived:2017-03-20 10:30:24
ActionScript3 source code
/**
* Copyright hacker_7bnhd5gd ( http://wonderfl.net/user/hacker_7bnhd5gd )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/nmsv
*/
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
public class Main extends Sprite
{
private var textField:TextField;
public function Main()
{
textField= new TextField();
textField.text = "test";
this.addChild(textField);
addEventListener(Event.ENTER_FRAME,onEnterFrame);
addEventListener(MouseEvent.CLICK,onClick);
}
public function onEnterFrame(event:Event):void
{
textField.text = Math.random().toString();
}
public function onClick(event:Event):void
{
textField.x = Math.random()*stage.width;
textField.y = Math.random()*stage.height;
}
}
}