I have seen numerous times that functions, timers and transitions are used within functions. but I want to know if I’m doing things right
local function showObject( event ) local alphaTmr if alphaTmr ~= nil then timer.cancel( alphaTmr ) alphaTmr = nil end local function objectAlpa() object.alpha = 1 end -------------------- if (someValue == 0) then --do something elseif (someValue == 1) then --do something else --blink object when number is equal to 2 if( someValue == 2 ) then alphaTmr = timer.performWithDelay(1050, function() transition.blink( object, { time=1000, onStart=objectAlpa } ) end ) end end --------------------- transition.fadeIn( object, { time=1000 } ) end
I’m canceling all the transitions in the scene hide.
Function purpose: I have a display oibject created with alpha = 0. The function is to change its fill image with some values and if the value is equal to 2 make it blink. Every time I enter the scene the object fades in.
Thanks in advance
DoDI