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

Visibility or opacity not working in a set interval function in HTML5

Community Beginner ,
Aug 28, 2022 Aug 28, 2022

Dear all, thank you for your time

I have a strange problem with visibility and opacity in a set interval function , every time i put

the code in I get an error in the console "Uncaught SyntaxError: invalid assignment left-hand side".

I tried putting == instead of =  error cleared but the visibility would not work.All other operations work inside the function, I also tried opacity as well but the results were the same.

 

function control(){

//abs reset
if ( this.swpanel_main.alt_mc.currentFrame == (0)&& this.swpanel_main.bat_mc.currentFrame == (0)&& this.main_mc.mainstart_mc
. currentFrame == (0))(
//Schematic

this.enginst_mc.amp_mc.gotoAndStop(0)&
this.enginst_mc.fqind_mc.gotoAndStop(0)&
this.enginst_mc.vac_mc.gotoAndStop(0)&
this.enginst_mc.fflow_mc.gotoAndStop (0)&
this.enginst_mc.oil_mc.gotoAndStop (0)&
this.bata_mc.visible = false &

this.tach_mc.tacind_mc.gotoAndStop(0)&

this.warnpnl_mc.wvac_mc.gotoAndStop(0)&
this.warnpnl_mc.wvolts_mc.gotoAndStop(0)&
this.warnpnl_mc.woil_mc.gotoAndStop(0)

)

//ABS
if ( this.swpanel_main.alt_mc.currentFrame == (5)&&this.swpanel_main.bat_mc.currentFrame == (5)
&&this.main_mc.mainstart_mc. currentFrame ==(20) )(

//Schematic

this.enginst_mc.amp_mc.gotoAndStop(33)&
this.enginst_mc.fqind_mc.gotoAndStop(15)&
this.enginst_mc.vac_mc.gotoAndStop(19)&
this.enginst_mc.fflow_mc.gotoAndStop (9)&
this.enginst_mc.oil_mc.gotoAndStop (19)&

this.tach_mc.tacind_mc.gotoAndStop(19)&

this.warnpnl_mc.wvac_mc.gotoAndStop(0)&
this.warnpnl_mc.wvolts_mc.gotoAndStop(0)&
this.warnpnl_mc.woil_mc.gotoAndStop(0)
this.bata_mc. visible = true;
)

}

setInterval(control.bind(this),100);

 

Full code 360 lines

 

I do not know what I am doing wrong ?

Best regards

Spycatcher

121
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

correct answers 1 Correct answer

Community Expert , Aug 28, 2022 Aug 28, 2022

did the forum mess up your code?  (use the insert code option to prevent that)

 

kglad_0-1661704044117.png

 

if not, you're using the bitwise ampersand (=&) operator, and you're using it in a way that does not make sense to me.  plus the formatting of your if-statement is incorrect.  that should be:

 

if(a&&b&&c){  // left curly bracket

// do whatever

}  // right curly bracket

Translate
Community Expert ,
Aug 28, 2022 Aug 28, 2022

did the forum mess up your code?  (use the insert code option to prevent that)

 

kglad_0-1661704044117.png

 

if not, you're using the bitwise ampersand (=&) operator, and you're using it in a way that does not make sense to me.  plus the formatting of your if-statement is incorrect.  that should be:

 

if(a&&b&&c){  // left curly bracket

// do whatever

}  // right curly bracket

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

Thank you very much my mistake when used the & the code worked so led me down a tunnel of adapting the code

to work now changed the if statement it worrks ok . Dont understand why the wrongnbrackets did not bring a consle error.

Best Regards

Peter

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.  (but you're making the same mistakes today in another post).

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