My Little Dead Riding Hood gif was quite simple to build. In Adobe Illustrator I created two separate illustrations, almost identical, but not quite (see below). I imported the layered Ai files into After Effects as compositions. I animated and then went back and forth, making one comp or the other comp visible in a final comp.
After animation, I rendered the final comp as a QuickTime movie, imported the movie into Adobe Photoshop and Saved for Web as gifs. (Check forever on the Looping Options drop down.) – Joe Gast
See all of my gifs here.