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

MouseOver problem

New Here ,
Feb 26, 2018 Feb 26, 2018

Hi i want create "hover" efect in my animation, when i go mouse to one elment i want show some images. I'm trying to do it, but something is wrong. Can you look at the code?

this.nota.visible = false;

var frequency = 3;

stage.enableMouseOver(frequency);

this.footer.addEventListener("mouseover", fl_MouseOverHandler_2);

function fl_MouseOverHandler_2()

{

this.nota.visible = true;

}

297
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

correct answers 1 Correct answer

Community Expert , Feb 26, 2018 Feb 26, 2018

Hi.

It's not working because 'this' inside of the function body doesn't refer to the main timeline.

Try this code:

var frequency = 3;

stage.enableMouseOver(frequency);

this.footer.on("mouseover", fl_MouseOverHandler_2.bind(this));

this.nota.visible = false;

function fl_MouseOverHandler_2()

{

    this.nota.visible = true;

}

I hope it helps.

Regards,

JC

Translate
Community Expert ,
Feb 26, 2018 Feb 26, 2018
LATEST

Hi.

It's not working because 'this' inside of the function body doesn't refer to the main timeline.

Try this code:

var frequency = 3;

stage.enableMouseOver(frequency);

this.footer.on("mouseover", fl_MouseOverHandler_2.bind(this));

this.nota.visible = false;

function fl_MouseOverHandler_2()

{

    this.nota.visible = true;

}

I hope it helps.

Regards,

JC

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