Code :
elseif (event.phase == “began” and event.other.myName == “death”) then
event.other : removeSelf()
event.other = nil
--transition.blink( myAnimation, { time=1000 } )
--myAnimation.alpha = 0.3;
--transition.to(myAnimation, {alpha=1, time=500})
myAnimation.trans = transition.blink(myAnimation,{time=500})
local function killBlink()
transition.cancel(myAnimation.trans)
display.remove(myAnimation)
myAnimation=nil
end
timer.performWithDelay(2000, killBlink)
At the end of the transition time I am getting this error :
11:49:47.582 ERROR: Runtime error
11:49:47.582 C:\Users\sht\Desktop\IndieG\default\Illanias Fate\main.lua:253: attempt to index global ‘myAnimation’ (a nil value)
11:49:47.582 stack traceback:
11:49:47.582 C:\Users\sht\Desktop\IndieG\default\Illanias Fate\main.lua:253: in function ‘?’
11:49:47.582 ?: in function <?:190>
Why is there a nil value error? How to fix this issue?