Skip to main content
Participating Frequently
Aug 28, 2022 11:54 PM UTC
Question

Visibility statement not working in HTML5

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 is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    kglad
    Community Expert
    Community Expert
    Aug 29, 2022 2:04 PM UTC

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

     

    Translate
    Participating Frequently
    Aug 29, 2022 11:31 PM UTC

    Yes I agree

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

    Translate
    kglad
    Community Expert
    Community Expert
    Aug 30, 2022 3:17 AM UTC

    you're welcome.

    Translate