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

html5 banners add addEventListener to create rollover states of MovieClip

Explorer ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

I am creating HTML5 banners in Adobe Animate CC (HTML Canvas). But I have never found an answer to this question. If I want a visual MovieClip to change on rollover thats easy using a instance of a button or event a movieClip using an "addEventListener".

The problem coming when the animation is turned into a banner for DoubleClick Manger/Studio etc we have to add a "a href" around the div = "animation_container" inside the body tag... this then takes the focus away from the rollover of the MC!!!

I found a way to trigger this event on rollover of the whole canvas tag see below - but is there away to only trigger this on rollover/out of the movieClip only?

canvas.addEventListener("mouseover", over.bind(this));

function over()

{

this.btn.gotoAndPlay("over_start");

}

canvas.addEventListener("mouseout", out.bind(this));

function out()

{

this.btn.gotoAndPlay("out_start");

}

Views

661

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
Enthusiast ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

Give your movie clip a label of btn on any keyframe it exists on.

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 ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

LATEST

Thats doesn't work.. it already has label of btn.

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