I have 4 variables I need to check the states of routinely... and
combinations thereof.

I am assuming that if I have a counter, and interogate and += them values, I
can then check the value of the counter to determine the combinations.

psudeo-code:

var counter:Number = 0;
if ( a ){ counter += 2; }
if ( b ){ counter += 3; }
if ( c ){ counter += 6; }
if ( d ){ counter += 12;}

if ( counter == 2 ){
     // only a was true
} else if ( counter == 3 ){
     // only b was true
}  ...

Which is fine, but thats gonna be one honkin' if else statement to catch all
the combinations.

Is there a better way of doing this that will catch all the possible
combinations in an elegant way?

- edolecki
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to