Skip to main content
Participant
November 9, 2018
Answered

The Simplest thing - MouseEvent.Click not Working

  • November 9, 2018
  • 1 reply
  • 582 views

I'm trying to build a really simple clickable prototype. There's a movie clip with an instance name "emailFocus" and when I click it's supposed to go to frame 5. Really easy, right?

But, it's not working at all. There's nothing happening on click.

Possible complications...

1. There is a large bitmap background

2. There is a static text object on top of my movie clip

What am I doing wrong?

-- the code --

stop();

emailFocus.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void

{

    gotoAndStop(5);

}

-- end of the code --

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

    Probably the static text field is preventing the Movie Clip instance from receiving the click event. It shoudn't happen by default but in the 2019 version the advanced layers mode is on by default and if this mode is active static text fields can get in the way.

    Try disabling the advanced layers mode (Ctrl/Cmd + J) or turn the text field into a Movie Clip and disable it with the mouseEnabled and/or mouseChildren properties.

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    November 9, 2018

    Hi.

    Probably the static text field is preventing the Movie Clip instance from receiving the click event. It shoudn't happen by default but in the 2019 version the advanced layers mode is on by default and if this mode is active static text fields can get in the way.

    Try disabling the advanced layers mode (Ctrl/Cmd + J) or turn the text field into a Movie Clip and disable it with the mouseEnabled and/or mouseChildren properties.

    Regards,

    JC

    jfx1026_Author
    Participant
    November 9, 2018

    That did the trick @

    Thanks a ton!

    JoãoCésar17023019
    Community Expert
    Community Expert
    November 9, 2018

    You're welcome!