That was only in the movie. However, as Gandalf and Radagast are both Maiar, it's possible they know how to communicate with animals as well as people.
We can read lips from impressive distances, Gandalf only has to mouth the words and Gwaihir will get his message. The moth thing was solely stylistic by Peter Jackson.
When did Gandalf communicate with a bat? As eldariontkd states, he only speaks with the moth(s) in the films. But, yeah, that's a trick he might have picked up from Radagast.