Fading Out Textures With Alpha Channels

I have an object that has a texture with an alpha channel on it. I want to get it to fade in and out but I can’t seem to get it to work. How do I do this?

Set object color to on

if object.color[4]>=.05:

How to: create transparency and perform fading for all Shading modes