Creating Mouse Interactions
package {
import flash.display.Sprite;
import flash.events.*;
import flash.geom.Point;
public class Main extends Sprite {
public function Main( ) {
var circle:Sprite = new Sprite( );
circle.x = 10;
circle.y = 10;
circle.graphics.beginFill( 0xFF0000 );
circle.graphics.drawCircle( 0, 0, 5 );
circle.graphics.endFill( );
circle.addEventListener( MouseEvent.MOUSE_MOVE, handleMouseMove );
addChild( circle );
}
private function handleMouseMove( event:MouseEvent ):void {
trace( "mouse move" );
}
}
}
Related examples in the same category