A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: advanced if statements?

  1. #1
    Member
    Join Date
    Aug 2003
    Posts
    43

    advanced if statements?

    I am trying to find out if there is a way that I can run an if statement like this:



    if(a == (1,4,6,8)){
    //do something
    }

    instead of doing something like this:

    if(a == 1 or a == 4 or a == 6 or a == 8)){
    //do something
    }



    edit:
    Actually, something like this would be even better:

    if((a == (1,4,6,8)) and (b == (1,4,6,8))){
    //do something
    }







    Thanks
    Last edited by Ojos Azul; 05-16-2005 at 11:53 PM.

  2. #2
    Member
    Join Date
    Dec 2003
    Location
    Gurgaon, India
    Posts
    64
    U can use switch case in this case,eg.,

    Code:
    switch(a)
    {
    	case 1:
    	case 2:
    	case 3:
    	case 4:
    		trace("voila");
    		break;
    
    }
    Hope this'll help.
    Flash makes the Web go Round

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