I am baffled, flash seems to be ignoring logic

I’m trying to get a rotating character to stop at around 0 or 360 degrees and then die.

All the following code is within an enter frame event.

This is the offending piece of code:-

if(cakeOrientation > 358);
{
trace(cakeOrientation);
cakemanRotate = 0;
removeEventListener(Event.ENTER_FRAME, cakeShuffle);
cakemanDies();
}

before this i have:-

cakemanRotate ++;
cakeman.rotation += cakemanRotate;
cakeOrientation += cakemanRotate;

if(cakeOrientation >= 360)
{
cakeOrientation -= 360;
}

i’ve traced cakeOrientation and it’s behaving normally and producing the right values but for some reason when it encounters this part:-

if(cakeOrientation > 358);
{
trace(cakeOrientation);

the number traced can be absolutely anything, i’ve had 3, 40, 280 and 340 so far. As you’d expect the object dies off at various angles.

This is really baffling me, please help :s

Thanks in advance,

Rich