rotateAroundInternalPoint

I’m using rotateAroundInternalPoint to rotate between 90 and 0 degrees on the click of a checkbox. The 90 degree rotation works fine, but when I try to rotate it back to 0, the rotation stays at 90. Can anyone tell me why that would be?

This is my code inside the handler for the checkbox. When I trace out the new rotation to go back to 0, I see rotate is 0, but the rotation is still 90.



private function onCheckboxChanged(event:Event):void {
            
(event.target.checked) ? rotate = 90 : rotate = 0;
            
var matrix:Matrix = mc.transform.matix;
MatrixTransformer.rotateAroundInternalPoint(matrix, xPoint, yPoint, rotate);    
mc.transform.matrix = matrix;

}