How do i make an object fade in and out?

So i have a button and i want it to have an effect of fading in and out… does that make sense? 

maybe this; https://docs.coronalabs.com/api/library/transition/blink.html

or use the transition.to function to vary an attribute over time, in this instance the .alpha property of the object.

https://docs.coronalabs.com/api/library/transition/to.html

from memory; transition.to( myobject, { time=1000, alpha=0 } ) will fade the object out over 1 second.

you can call a function on completion of a transition, which can be used to call another transition.

something like;

local fo local fi = function() transition.to( myobject, { time=1000, alpha=1, onComplete = fo } ) end local fo = function() transition.to( myobject, { time=1000, alpha=0, onComplete = fi } ) end fo()

but that is out of my head, i have not tested it.

i figured it out… i had the transition.to functions set up and i found the alpha thing in the forums… but thanks for the help!

maybe this; https://docs.coronalabs.com/api/library/transition/blink.html

or use the transition.to function to vary an attribute over time, in this instance the .alpha property of the object.

https://docs.coronalabs.com/api/library/transition/to.html

from memory; transition.to( myobject, { time=1000, alpha=0 } ) will fade the object out over 1 second.

you can call a function on completion of a transition, which can be used to call another transition.

something like;

local fo local fi = function() transition.to( myobject, { time=1000, alpha=1, onComplete = fo } ) end local fo = function() transition.to( myobject, { time=1000, alpha=0, onComplete = fi } ) end fo()

but that is out of my head, i have not tested it.

i figured it out… i had the transition.to functions set up and i found the alpha thing in the forums… but thanks for the help!