Sorry, this demo requires the Flash Player.

Most of our other demos are HTML5-compatible.

Get Adobe Flash player


source code

FlxMouseEvent allows FlxSprites to listen to mouse events like MouseDown, MouseUp, MouseOver and MouseOut.

To activate it, simply add sprites and implement the event callbacks:

import flixel.input.mouse.FlxMouseEvent;

var sprite = new FlxSprite();
FlxMouseEvent.add(sprite, onMouseDown, onMouseUp, onMouseOver, onMouseOut); 

function onMouseDown(sprite:FlxSprite) {}
function onMouseUp(sprite:FlxSprite) {}
function onMouseOver(sprite:FlxSprite) {}
function onMouseOut(sprite:FlxSprite) {}