Skip to main content
Participant
Sep 13, 2022 1:58 PM UTC
Answered

Show And Hide Button

Hi everyone,

I am very new to Adobe Animate so I am making my first steps with the software. 

I would like to have a button (button_2) that simply shows and hide some text (movieClip_1). 

I manage to make it first hidden and then visible but I do not know how to hide it again. 

Perhaps I could use a loop? 

 

var _this = this;
_this.movieClip_1.visible = false;

var _this = this;
_this.button_2.on('dblclick', function(){
_this.movieClip_1.visible = true;
});

 

Thank you

    This topic is closed to new replies. Start a new post to keep the conversation going.
    JoãoCésar17023019
    JoãoCésar17023019Correct answer
    Community Expert
    Sep 13, 2022 2:05 PM UTC

    Hi.

     

    Trying using the logical NOT operator.

     

    Like this:

    var _this = this;
    
    _this.movieClip_1.visible = false;
    
    _this.button_2.on('dblclick', function ()
    {
        _this.movieClip_1.visible = !_this.movieClip_1.visible;
    });

     

    I hope it helps.

     

    Regards,

    JC

    3 replies

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    Sep 13, 2022 2:05 PM UTC

    Hi.

     

    Trying using the logical NOT operator.

     

    Like this:

    var _this = this;
    
    _this.movieClip_1.visible = false;
    
    _this.button_2.on('dblclick', function ()
    {
        _this.movieClip_1.visible = !_this.movieClip_1.visible;
    });

     

    I hope it helps.

     

    Regards,

    JC

    Translate
    Participant
    Sep 13, 2022 2:08 PM UTC

    Thank you so much ! 

    Translate
    JoãoCésar17023019
    Community Expert
    Community Expert
    Sep 13, 2022 2:17 PM UTC

    You're welcome!

    Translate