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

How to make an invisible top layer clickable (HTML5 Canvas)

Community Beginner ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

Hi guys. What is the best way to make a top layer invisible but still accessible for mouse events in Animate CC for HTML5 canvas?

When I set alpha to 0% the layer is not available for any events. So my workaround is to set the top layer to alpha 1%, but that does not seem like a really clean solution. Can you please advise if there is a better way to do this? Thanks a lot!

I would like to use the top layer for various events simultaneously like click to go to URL, mouse-over to unmute video, mouse-out to mute video etc.!

Views

1.9K

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

LEGEND , Nov 10, 2016 Nov 10, 2016

The actual, non-hackish way to do this is to create your cover clip as a Button with your layer box in the Hit frame only.

Votes

Translate

Translate
Community Expert ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

i recall having to do the same.

p.s. if you find the 1% alpha unacceptable design-wise, you can create a parent movieclip, add your 1% alpha movieclip to that parent and assign an alpha of 0 to the child and your click will still work on the parent that is totally transparent.

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 ,
Nov 10, 2016 Nov 10, 2016

Copy link to clipboard

Copied

The actual, non-hackish way to do this is to create your cover clip as a Button with your layer box in the Hit frame only.

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 ,
Nov 11, 2016 Nov 11, 2016

Copy link to clipboard

Copied

Thank you very much for your answers guys!

@kglad: I tried that. Strangely the parent clip was still not accessible for events for me.

@ClayUUID: Your solution works perfectly, thanks again!

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 ,
Nov 11, 2016 Nov 11, 2016

Copy link to clipboard

Copied

LATEST

You're welcome. If you found that to be the correct solution to your problem, please tag the post as such.

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