 // Flump - Copyright 2013 Flump Authors
 
 package flump.xfl {
+
+import com.adobe.crypto.MD5;
+import com.threerings.util.Log;
+import com.threerings.util.Map;
+import com.threerings.util.Maps;
+import com.threerings.util.Set;
+import com.threerings.util.Sets;
+import com.threerings.util.XmlUtil;
 
 import flash.filesystem.File;
 import flash.utils.ByteArray;
 import flash.utils.Dictionary;
-
-import com.adobe.crypto.MD5;
 
 import flump.SwfTexture;
 import flump.Util;

        if (!_toPublish.add(movie)) return;
        for each (var layer :LayerMold in movie.layers) {
            for each (var kf :KeyframeMold in layer.keyframes) {
                function adjustPivot (tex :SwfTexture) :void {
                    // Texture symbols have origins. For texture layer keyframes,
                    // we combine the texture's origin with the keyframe's pivot point.
                    kf.pivotX += tex.origin.x;
                    kf.pivotY += tex.origin.y;
                };
                if (movie.flipbook) {
                    adjustPivot(SwfTexture.fromFlipbook(this, movie, kf.index));
                } else {
                    if (kf.ref == null) continue;
                    kf.ref = _libraryNameToId.get(kf.ref);

                    } else if (item is MovieMold) {
                        prepareForPublishing(MovieMold(item));
                    } else if (item is XflTexture) {
                        const tex :XflTexture = XflTexture(item);
                        try {
                            swfTexture = SwfTexture.fromTexture(this.swf, tex);
                        } catch (e :Error) {
                            addTopLevelError(ParseError.CRIT, "Error creating texture '" + tex.symbol + "'");
                            swfTexture = null;
                        }
                    }
                }

                if (swfTexture != null) {
                    // Texture symbols have origins. For texture layer keyframes,
                    // we combine the texture's origin with the keyframe's pivot point.
                    kf.pivotX += swfTexture.origin.x;
                    kf.pivotY += swfTexture.origin.y;
                }
            }
        }
