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

How to remove hand pointer cursor from button rollover

Explorer ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

Hello I'm looking for a way to remove the hand cursor that appears when you roll over a button

I'm working in html5 canvas

Thanks!

Views

4.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Mar 27, 2017 Mar 27, 2017

yourbutton.useHandCursor = false;

Votes

Translate

Translate
Community Expert ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

yourbutton.useHandCursor = false;

Votes

Translate

Translate

Report

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
Explorer ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

Thank you!

Where to place this code?

Votes

Translate

Translate

Report

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 ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

in the actions panel at the keyframe where you want to disable the button's hand cursor.

Votes

Translate

Translate

Report

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
Participant ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Hello, this seems to be needed even when a button is under another graphic, effectively creating an invisible button. I see that there's a way to intentionally cause this by not assigning key frames to any button states, but Hit. But is there a way to prevent the cursor from changing to a pointer when it is over a button that is under a graphic and not visible?

Votes

Translate

Translate

Report

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 ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

yes, same solution.

Votes

Translate

Translate

Report

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
Participant ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Ok, but just wondering, when a button isn't clickable or visible shouldn't it default to not showing a pointer? Shouldn't this be reported as a bug if a button that isn't visible, or clickable, still turns the cursor to a pointer?

Votes

Translate

Translate

Report

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
Participant ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Ok, bug or not a bug aside, I'm still getting a hand pointer cursor when I apply the following at frame 1, (where I'm listening to each of 4 buttons):

 

Trigger_1.useHandCursor = false;
Trigger_2.useHandCursor = false;
Trigger_3.useHandCursor = false;
Trigger_4.useHandCursor = false;

Trigger_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_6);

function fl_ClickToGoToAndPlayFromFrame_6(event:MouseEvent):void
{
gotoAndPlay(2);
}

 

Am I missing something?

Votes

Translate

Translate

Report

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 ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

 maybe an overlying button?

 

test by assigning visibility to false to see if you still get a hand cursor on mouse over

Votes

Translate

Translate

Report

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
Participant ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Ok, thanks again for your reply and your patience. I have to root through this some more since, somehow it's working for one, the 1st, button, but not the others. I didn't need to turn off visibity since my problem was that I had the assignments on the wrong side of a listener function. But I'll have to track down any differences that might explain why the same sequence isn't working for the other 3 buttons.

Votes

Translate

Translate

Report

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
Participant ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Preventing the cursor from changing to the hand pointer still seems non-deterministic. Even if turning the button off helps, which I couldn't confirm, that causes a flash in a cross fade since there's no way to fade that out. I'll break it down into smaller exercises but, when the only place the HandCursor is set to true is at frame 1, could there be a circumstances that implicitly sets it back to true, without going to frame 1, after explicity setting it to false?

Votes

Translate

Translate

Report

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 ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

as i understand your setup, you have objects overlying each other and you need help determining what object the cursor is responding to.

 

if that's true, toggling visibility will allow pinpointing the the object.

 

if it's not true, ignore the visibility tests.

Votes

Translate

Translate

Report

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
Participant ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

Yes, I do have an overlay that covers buttons when one of them is clicked, and the hand pointer seems to correspond to where the covered buttons are, even after setting the handcursor to false before playing the overlay sequence. It sounds useful to toggle visibility but, as I understand it, that involves setting the alpha to 100, where it may have been 0. But in this case, the button is occluded by another layer, so I'm not aware of something that allows a lower layer to be visible, even as an outline. Is there such a function? Also, is there a way to list all of the assets contained in a selected layer? I'd like to exclude the possibility of a stray duplicate button in a layer. If it's relevant, I had to turn off advanced layers since that seemed to be necessary to allow multiple buttons without needing to readdress them through a layer hierarchy.

Votes

Translate

Translate

Report

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 ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

no, you misunderstand. (setting a buitton's alpha to 0 will NOT disable the handcursor, while setting its visible property to false WILL disable the handcursore)

 

first, make sure you save a copy of your current fla (with a new name, eg version number appended) in case the following steps cause unwanted clutter.

 

select the timeline/frame where your button is located and where there are overlying objects.

unlock all layers

using the selection tool drag a rectangle around the region on stage where you mouse changes to indicate a button. 

right click over the selected objects>click distribute to layers

now make sure you can locate each of those layers because one of them contains the culprit

 

test to make sure the unwanted handcursor still appears

now, assign your button's useHandCursor property to false , if it's not already assigned at that timeline/frame

test.

 

still see the hand cursor?  if so, you're ready to find the culprit

 

check the objects in those new layers.  anything that's not a movieclip, graphic or button can be excluded from consideration.  only those 3 objects can cause a mouse response.

 

for each object that's in one of those 3 categories, add its instance name (in the properties panel) to a list that you'll use to find the culprit. (if it has no instance name, assign one.)

 

then for each object in your list, assign them all visible property false.

test

 

you should not see a handcursor in the timeline/frame/stage location

 

now, comment-out about 1/2 those visible statements

test

 

if you see the cursor, the culprit's in the 1/2 that are still commented-out.  if you don't see the cursor it's in the 1/2 that were active.

 

continue by 1/2 until you pinpoint the culprit.  that should only take about n steps for 2**n objects in the list.

 

once you find the culprit, you can remove all the visible statements and assign that object's useHandCursor property to false

Votes

Translate

Translate

Report

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
Participant ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

BTW, this was resolved by switching to zero alpha overlay buttons that are only present when that menu is offered, rather than making the persistent graphic a button. Thanks again for your advice.

Votes

Translate

Translate

Report

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 ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

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
LEGEND ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

useHandCursor is the ActionScript solution. In Canvas you use .cursor.

button.cursor = "pointer"; // hand cursor

button.cursor = "default"; // default cursor

You can set it to any CSS cursor type.

cursor - CSS | MDN

Votes

Translate

Translate

Report

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 Beginner ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

Thank you! Very helpful hint about Canvas

Votes

Translate

Translate

Report

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