Switch case executes "false"s too?

var myConstant:Number = 3
for (var i:int = 0; i < 30; i++)
{
switch (true)
{
case i > 20:
trace(i,">20");
case i % myConstant == 0:
trace(i,i % myConstant == 0,i % myConstant);
default:
}
}

why does it suddenly start tracing ‘false’ after 20???
weird

Because you forgot a break statement before your second case.

[QUOTE=Krilnon;2663074]Because you forgot a break statement before your second case.[/QUOTE]

actually, it took the breaks out to test if for every “i” it indeed would execute all cases it actually matches (so if it matches more then 1 of the possible cases)

it does but it also starts suddenly executing/matching the false cases