Hey, here's an idea, maybe Dobby becomes invisible when he snaps his finger, then sneeks out, yeah, that might be it, because Hermione says it all the time that nobody can apparate or disapparate inside Howgarts, not even Voldemort, and thats why Voldy can't apparate either, because if he knew that house elves can apparate inside Hogwarts then he would'v done anything to have that kind of power, and have it too. But pity, because in the movie it's shown that Harry is holding Dobby in his fist and the next second he is gone, I wonder how are they going to explain this to the other fans, it was a really stupid thing to do, they should'v just shown that Harry got surprized that Dobby disappeared thet he let go of his hand almost instantly. Well, I'm guessing that, and it's bound to be maybe, that people wont accept the fact that a common house slave can do a thing with just a snap of it's finger, that even the great Dark Lord can't do, sheesh!
PS: REMEMBER PEOPLE, YOU HEARD THIS FROM ME FIRST.