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

Visibility statement not working in HTML5

New Here ,
Aug 28, 2022 Aug 28, 2022

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(&)
)
}

 

135
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 ,
Aug 29, 2022 Aug 29, 2022

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

 

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
New Here ,
Aug 29, 2022 Aug 29, 2022

Yes I agree

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

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 ,
Aug 29, 2022 Aug 29, 2022
LATEST

you're welcome.

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