Honestly, I was so young and it was so long ago I can't be sure if it was actually anime, but from my memory I believe it was, the style from what I can remember reminded me of Howl's Moving Castle, though I still can't be sure as it was so long ago.
The movie was about a boy who is sleeping and all of a sudden taken to this sort of Eutopia with wonderous people and creatures. I remember there being these three weasel like characters, one tall and thin, one short and one in between who were sort of the comic relief. The boy is treated specially, and given a key that unlocks anything in the kingdom. Another character which I can't remember what he was like is curious about this door that the boy is told not to unlock, and wants to know what's behind it. He gets the boy to unlock it but they don't see anything and then leave before they are caught. ((I can't remember if they saw what was behind the door or not...very rusty memory)) However, when they leave they forget to lock the door. Later at what I think was a ball, the thing that was behind the door escapes. It turned out it was this black goop/ink like substance that was sentient and it captures the king, enveloping him and then making him dissapear. I can't remember what happens next But I remember the boy ending up back home on his bed. I believe the weasel like characters get him to come back as the whole kingdom is falling apart and is being captured by the goop, which is working for some sort of super evil bad guy. The bad guy has many of the characters captured in glass cases and is huge and big and ugly ((I know bad description, cut me a break it was a long time ago)). Somehow the boy saves the day with the help of his friends and I can't remember how it ends.