Skip to main content
Known Participant
June 19, 2017
Answered

Hiding and unhiding movieclips in HTML5

  • June 19, 2017
  • 1 reply
  • 1658 views

I'm putting something together with an HTML5 canvas.  I want to be able to hide and reveal certain movieclips by clicking on buttons.  This is a really simple thing I've done several times in the past with actionscript3 but I'm not sure how to translate it HTML5.  The code I used to use was "Instance_Name.visible=false" or "Instance_Name.visible=true"

Does anybody know the HTML equivalent of that?

Thanks

This topic has been closed for replies.
Correct answer just.emma

this.Instance_Name.visible = false;

1 reply

just.emma
just.emmaCorrect answer
Inspiring
June 19, 2017

this.Instance_Name.visible = false;

Known Participant
June 19, 2017

Thanks!  That works....I've encountered something weird now though.  To make that movieclip visible again I have a Mouse Click Event Handler applied to a button, but for some reason it's not working and I can't see why...

The code looks like this:

this.AlienVaderBTN.addEventListener("click", fl_MouseClickHandler_4.bind(this));

function fl_MouseClickHandler_4()

{

  this.AlienVader.visible = true;

}

Known Participant
June 19, 2017

Wait....seem to have figured it out...had it in the wrong place on teh timeline