Copy link to clipboard
Copied
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;
}
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
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now