Link to home
Create AccountLog in
Avatar of roscoeh23
roscoeh23

asked on

custom pointer working but not clicking

I have created a custom cursor which works howerver it does not trigger a click event. When I comment it out it works.

any ideas?
//stage.addEventListener(Event.ENTER_FRAME, moveMouse);
//
//function moveMouse(Event) {
//Mouse.hide();
//cursor_mc.x = mouseX;
//cursor_mc.y = mouseY;
//}
 
 
faceType1_mc.addEventListener(MouseEvent.CLICK, faceType1);
 
 
	function faceType1(event:MouseEvent):void {
	trace('I was clicked');
	
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
In AS3,

Each element whether it is  a button or not, even textfields also take mouse action and works like wall for all items beneath.
hence, here cursor_mc always remains at the tip of exact mouse position and it is also on the top of "faceType1_mc" movieClip/button, that so it stops mouseevents

so, we need to disable it for cursor_mc on stage by setting mouseEnabled = false;