Skip to main content
Participating Frequently
June 1, 2021
Question

Using MouseOver to make a movie clip symbol appear

  • June 1, 2021
  • 2 replies
  • 863 views

Hello All, 

 

I am really struggling at the moment with an HTML5 project in Animate 2021. I cannot get ANY of my MouseOver or MouseOut events to work. My timeline is playing fine and the project stops on the slide I indicated and the eyes01 movie symbol is not visible, however that is where the successes end. 

 

I need the movieclip eyes01 to appear when you hover over Topic1 then disappear when your mouse leaves Topic1. I have eyes01 on a layer above the buttons if that makes any difference whatsoever. I have tried making images come up when you hover over Topic1, tried to get it to gotoAndPlay a different frame when you hover, absolutely NONE of them work. Grrr...

 

Here is my code, PLEASE HELP!

this.stop();

this.eyes01.visible=false;


var frequency = 9;
stage.enableMouseOver(frequency);
this.Topic1.addEventListener("mouseover", fl_MouseOverHandler_6.bind(this));

function fl_MouseOverHandler_6()
{
this.eyes01.visible=true;
}


var frequency = 9;
stage.enableMouseOver(frequency);
this.Topic1.addEventListener("mouseout", fl_MouseOutHandler_2.bind(this));

function fl_MouseOutHandler_2()
{
this.eyes01.visible=false;
}

 

Thank you for your assistance!

    This topic has been closed for replies.

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    June 2, 2021

    Hi.

     

    You don't need to repeat the enable mouse over call, but other than this your code is correct.

     

    Does your Topic1 instance have a well-defined hit area? If you're not sure about it, would mind sharing your FLA?

     

    Regards,

    JC

    jssamAuthor
    Participating Frequently
    June 2, 2021

    It does have a well defined border. I have drawn a rectangle over the text in the "hit" frame. Hmm.... Okay, thanks for checking the code. 

    I'm trying to attach the .fla for you to look at but when I try to post it with the attachment, this error comes up and it won't let me, 

    "Correct the highlighted errors and try again.

    The attachment's td curated learning original.fla content type (application/octet-stream) does not match its file extension and has been removed."

    Any ideas on what I'm doing wrong? 

    JoãoCésar17023019
    Community Expert
    Community Expert
    June 2, 2021

    Got it.

     

    I think it's easier to upload your FLA to a file sharing service like Adobe Creative Cloud, Dropbox, Google Drive, or WeTransfer and post the link here if this is not a problem for you.

    Lilybiri
    Legend
    June 2, 2021

    Not sure why you post this in the Captivate forum. It is much easier in Captivate to create such a button, no need for JS. But you should post your question in the Animate forum. I will move it to that forum.

    jssamAuthor
    Participating Frequently
    June 2, 2021

    So sorry! You are absolutely correct. I'm working in both programs simultaneously and just blanked on which one I needed.... 

    Thanks!