Skip to main content
Participating Frequently
August 28, 2022
Question

Visibility statement not working in HTML5

  • August 28, 2022
  • 1 reply
  • 140 views

Dear All 

I am trying to get a visibility(or opacity) statements working in a IF statement,If I use one visibility in the output of the  IFstatement it works, add another and the movie will not run in the browser and I get a console left side error 

If I delete one of the visible callouts in each it works, I also tried adding(;) and(&) to join statements also did not work  .If  I use normal statement and I use (&) to join together such as:

this black_mc.gotoAndStop(2) & this.redball_mc.gotoAndStop(2)

it works fine and I can add as many statements as I like, only the visibility (or opacity) seems to cause problems.

Thank for your help

this.black_sw.addEeventListener("click",f1_ClickToHide.bind(this));
function f1_ClickToHide()
{
 if (this. black_mc. visible == true)(
this.black_mc. visible = false
this.redball_mc. visible = true)
else if (this. black_mc. visible == false)(
this.black_mc. visible = true
this.redball_mc. visible = false
)
}
// this works
this.black_sw.addEeventListener("click",f1_ClickToHide.bind(this));
function f1_ClickToHide()
{
 if (this. black_mc. visible == true)(
this.black_mc. gotoAndStop(2)&
this.redball_mc. gotoAndStop(2)
else if (this. black_mc. visible == false)(
this.black_mc. gotoAndStop(4)&
this.redball_mc. gotoAndStop(4)
// will not work without(&)
)
}

 

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    August 29, 2022

    same problem as yesterday with improperly formatted if-statements and inappropriate bitwise operators (though the statements will execute).  

     

    Participating Frequently
    August 29, 2022

    Yes I agree

    Thank you just getting back into adobe animate after a long hiatus did not spot my error thank you.

    kglad
    Community Expert
    Community Expert
    August 30, 2022

    you're welcome.