A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: combining && + ||

  1. #1
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215

    combining && + ||

    hey dudes

    is it possible to combine both "and" + "or" scripts?

    like if i have _root.something == true &&/|| _root.something == true

    is that possible? that it sez if both, or if one of them is true?
    then do something?

    thx
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    You would just extend your if statement...

    code:

    if(something){
    do something;
    }else if(somethingElse){
    do something else;
    }else{
    do the regular;
    }


  3. #3
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    Quote Originally Posted by Zirclesoft
    hey dudes

    is it possible to combine both "and" + "or" scripts?

    like if i have _root.something == true &&/|| _root.something == true

    is that possible? that it sez if both, or if one of them is true?
    then do something?

    thx
    Maybe I'm missunderstanding the question but...

    You do not need to combine them. That is what the or(||) operator does. It requiers that one or both of the expressions evaluate to true.

    /Mirandir

  4. #4
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    waahahha ohh i get it

    thanks dudes! i didnt know the || statement would say

    that if one or both of them were true...thanks
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center