Skip to main content
Participant
September 13, 2022
Answered

Show And Hide Button

  • September 13, 2022
  • 1 reply
  • 385 views

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 has been closed for replies.
    Correct answer JoãoCésar17023019

    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

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    September 13, 2022

    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

    Participant
    September 13, 2022

    Thank you so much ! 

    JoãoCésar17023019
    Community Expert
    Community Expert
    September 13, 2022

    You're welcome!