Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

custom cursor click

Contributor ,
May 21, 2013 May 21, 2013

I'm using this to create a custom cursor and to use a mouse click event on a movieclip:

stop();

Mouse.hide();

stage.addEventListener(MouseEvent.MOUSE_MOVE,follow);

function follow(evt:MouseEvent)

{

          cursor_mc.x = mouseX;

          cursor_mc.y = mouseY;

}

//

volgendePijlClip.addEventListener(MouseEvent.CLICK, pijlEventClip);

function pijlEventClip(event:MouseEvent):void

{

          trace(1)

}

At first it didn't work for me, but I found out that was because the custom cursor was over its registration point. Which was made equal to the mouse's location. So when the mouse was clicked on the movieclip-button, it was actually clicking on the custom mouse cursor itself, so the click on the 'volgendePijlClip movieclip wasn't picked up on.

I solved it by moving the custom cursor slightly away from it's registration point, so it would appear slightly of mouseX/mouseY. Close enough to act as cursor, but away of the cursor enough so the hidden mouse cursor could pick up a click on 'volgendePijlClip'.

Was wondering if there still was a way for a custom cursor to be over it's registration point and have the hidden mouse cursor still pick up on clicking on objects beneath the custom cursor?

TOPICS
ActionScript
485
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 21, 2013 May 21, 2013
LATEST

assign its mouseEnabled property to false:

cursor_mc.mouseEnabled=false;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines