Skip to content


Display Hand Cursor On MouseOver Of Sprite/MovieClip

I have been using MovieClips and Sprites that have MouseEvents bound to the objects. My issue was the mouse cursor would not change to a hand when rolled over the object. Fortunately there is a quick fix for this, you can mouse over the circle below for a demonstration.

Here is the Document Class:

package
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	public class HandCursor extends Sprite
	{
		public function HandCursor()
		{
			var circle:Sprite = new Sprite();
			circle.graphics.beginFill(0x336699);
			circle.graphics.drawCircle(100, 100, 50);
			// to display the hand cursor you need the following 2 lines
			circle.buttonMode = true;
			circle.useHandCursor = true;
			// ---------------------------------------------------------

			addChild ( circle );
		}

	}
}

Posted in Actionscript 3.


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. vish says

    No need of useHandCursor = true; i think!! cause enabling buttonMode=true will automatically display hand over display object. anyways, thanks for sharing.

  2. Ramdas says

    It was helpful and quick. Thanks

  3. balaji swaroop says

    really very helpful…



Some HTML is OK

or, reply to this post via trackback.