         for each (frameEl in xml.frames.DOMFrame) {
             if (ii >= layer.keyframes.length) break;
 
+            kf = layer.keyframes[ii];
+
             if (XmlUtil.hasAttr(frameEl, "motionTweenRotateTimes") &&
                 XmlUtil.hasAttr(frameEl, "motionTweenRotate")) {
                 var thisRotation :Number =

                if (XmlUtil.getStringAttr(frameEl, "motionTweenRotate") == "clockwise") {
                    thisRotation *= -1;
                }
                additionalRotation += thisRotation;
            }

            kf = layer.keyframes[ii];
            kf.rotation += additionalRotation;

            ii++;

        return Math.round(n * shift) / shift;
    }

    protected static function sign (n :Number) :Number {
        return (n > 0 ? 1 : (n < 0 ? -1 : 0));
    }

}
}
