An alternative I just thought of, which might be cleaner, is to have a custom class "my.db.Object", which you always extend.
package my.db;
#if (php || neko)
typedef Object = sys.db.Object;
#else
class Object
{
public function new() {}
}
#end
This way, your code doesn't have to get ugly with conditional compilation all over the place. Just extend this object, and it'll work on your server, and it will also work on your client. If you're feeling really clever, you could even add some helper methods to your client-side object, for example "save()" could start a remoting call that calls save() on the server.
Might be worth a blog post exploring these tricks :)
Hope this helps,
Jason