How to change materials in animation? I want to animate the changing of materials my model.

After the first frame I want to around blocks (or just the colors of the blocks) to and from somewhere in the model.

Here is a picture of what I'm trying to do: 

I'm going to import the .blend file into unity. I just want the animation to play over and over again (like a gif).
You can do this with a VideoTexture script, use the script at the bottom of this thread

http://blenderartists.org/forum/showthread.php?189973-Changing-object-textures-in-game-engine-quot-on-the-fly-quot-(animated-textures)