 	{
 	    // clamp the rotation value between -180 and 180.  This is what 
         // the Flash player does, so let's mimic it here too.
-        if (value > 180 || value < -180)
-        {
-            value = value % 360;
-            
-            if (value > 180)
-                value = value - 360;
-            else if (value < -180)
-                value = value + 360;
-        }
+		value = MatrixUtil.clampRotation(value);
         
 		if ((_flags & PROPERTIES_VALID) == false) validatePropertiesFromMatrix();
 		if(value == _rotationY)

	{
	    // clamp the rotation value between -180 and 180.  This is what 
        // the Flash player does, so let's mimic it here too.
        if (value > 180 || value < -180)
        {
            value = value % 360;
            
            if (value > 180)
                value = value - 360;
            else if (value < -180)
                value = value + 360;
        }
        
		if ((_flags & PROPERTIES_VALID) == false) validatePropertiesFromMatrix();
		if(value == _rotationZ)

	{
	    // clamp the rotation value between -180 and 180.  This is what 
        // the Flash player does, so let's mimic it here too.
		value = MatrixUtil.clampRotation(value);
            
		if ((_flags & PROPERTIES_VALID) == false) validatePropertiesFromMatrix();
		if(value == _rotationX)
