Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Disable buttons on Adobe animate canvas

Community Beginner ,
May 16, 2023 May 16, 2023

Hi All,

I am trying to disable 5 buttons from a movieclip timeline so they're out of use though still visable.

 

Currently I have 1 button controling 1 movieclip, the button tells the movieclip move forward one frame and play, this plays till frame 5 and stops _this.stop(); and at this point I need to tell the _root timeline to disable 5 buttons.

 

By clicking a close button _this.play(); the frame plays out frame 6 to 10 and I will need to enable the 5 buttons again before frame 10.

 

Whats the best way to disable and enable a button, is it from an action or on enter frame. Could someone plaese help me with this Adobe Animate Canvas code please?

 

Button controlling movieclip

var _this = this;
_this.secure_btn.on('click', function(){
_this.Secure_Overlay.gotoAndPlay(2);

});

 

Thanks

 

511
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2023 May 16, 2023

Hi.

 

You can either set the property mouseEnabled to false on the buttons to disable mouse interaction on them or set the property mouseChildren to false on the Movie Clip that contains them so that all children in it won't react to the mouse. Then you can just set these properties back to true to enable the buttons again.

 

I hope it helps.

 

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 16, 2023 May 16, 2023

Hi JC,

 

Thanks for the reply, could I ask how you would write this in a frame?

 

Currently my end frame talks to the current MovieClip, but how do i talk to the root?

 

'Secure_Overlay' is my current MovieClip endFrame

var _this = this;
_this.gotoAndStop(1);

 

How would I add to disable secure_btn from being active?

 

Is it _root.secure_btn.mouseDown(false);

 

Thanks

Justin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2023 May 16, 2023
LATEST

you can use exportRoot.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines