Click event

A basic use of the MouseEvent.CLICK event :

output

Alternative content

Get Adobe Flash player

package;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.Lib;

      class Main
      {
      		static function main()
      		{
      			new Main();
      		}
      		public function new()
      		{
				/*Create a new textField*/
				var t = new TextField();
				t.text = "Click here.";
				
				/*Make it unselectable*/
				t.selectable = false;
				
				/*Add it on the scene*/
				Lib.current.addChild(t);
				
				/*Add an event listener on the textfield*/
				t.addEventListener(MouseEvent.CLICK, function(e:MouseEvent)
				{
					t.text = "...you clicked";
				});				
      		}
      }
				

Compile and test :

haxe -swf9 MouseClick.swf -main Main 
(33 times)