             return dest;
         }
 
-        // TODO: Our own encoding, that takes into account
-        // the ApplicationDomain.. ACK
+
         var bytes :ByteArray = new ByteArray();
         bytes.endian = Endian.BIG_ENDIAN;
         bytes.objectEncoding = ObjectEncoding.AMF3;
+        // FIX, Because adobe is FUCKING IT UP as usual.
+        // It seems that with flash 10, they "enhanced" AMF3 encoding. That's great and all,
+        // except when we try to send this data back to a flash 9 player, which can't read it.
+        // Guess what, asshats? If you change the encoding spec, IT'S NOT THE SAME VERSION ANYMORE.
+        // Thanks for breaking all our code where we explicitly set AMF3, even though
+        // it's currently the default.
+        if (obj is Dictionary) {
+            var asArray :Array = [];
+            for (var key :* in obj) {
+                asArray.push(key);
+                asArray.push(obj[key]);
+            }
+            obj = asArray;
+            // then insert our special marker byte before writing this array
+            bytes.writeByte(DICTIONARY_MARKER);
+        }
         bytes.writeObject(obj);
         return bytes;
     }

        // array used to encode (and not a network reconstruction)
        bytes.position = 0;

        // TODO: Our own decoding, that takes into account
        // the ApplicationDomain.. ACK
        bytes.endian = Endian.BIG_ENDIAN;
        bytes.objectEncoding = ObjectEncoding.AMF3;
        return bytes.readObject();
    }

    /**

    staticInit();

    /** Non-simple classes that we allow, as long as they are not subclassed. */
    protected static const VALID_CLASSES :Array = [
        "flash.utils.ByteArray", "flash.geom.Point", "flash.geom.Rectangle" ];
}
}
