AS3 Switch Case
Written by Philip
Hello hope your well, I thought I'd write a simple AS3 Switch/Case just incase anyone forgets, as I know I do sometimes! When I've been using lots of If Else's.This can of course be used in Flash and Flex.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
switch(condition) { case condition 1: trace("Condition 1 was met"); break; case condition 2: trace("Condition 2 was met"); break; case condition 3: trace("Condition 3 was met"); break; default: trace("None of the above were met"); }
|