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

If statement structure problem

New Here ,
May 03, 2013 May 03, 2013

for whatever reason my code isnt behaving the way it should, and I was wondering if anyone can take a look at it.

Im trying to prevent something firing if text select is equal to a certain name.

it works when I have just one ex. textSelect.name != "b3" but not when I try to add or statements

if (textSelect.name != "b3"  || textSelect.name !=   "b5"  || textSelect.name != "b6" ||textSelect.name !=   "b7" || textSelect.name != "b8" || textSelect.name != "b9" ||textSelect.name != "b10"||textSelect.name != "b11"||textSelect.name !=  "b12"|| textSelect.name !=  "b13" || textSelect.name != "b14" ) {

          if (textSelect.numLines < 2 && control == "on" && menu1.visible == false)

          {

trace(textSelect.name);

trace("ok");

}

}

TOPICS
ActionScript
348
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

LEGEND , May 03, 2013 May 03, 2013

Your logic is not going to work.  It is guaranteed that only one of them at most is going to be equal, so all others have to be not equal.

If you cannot reason out how to code what you really want, explain what you are trying to get the code to do.

Translate
LEGEND ,
May 03, 2013 May 03, 2013
LATEST

Your logic is not going to work.  It is guaranteed that only one of them at most is going to be equal, so all others have to be not equal.

If you cannot reason out how to code what you really want, explain what you are trying to get the code to do.

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