I have the following function:
function fadeRect(event) transition.to(event.target, {time=2000, alpha=0.5, onComplete= function() if event.target then event.target:removeSelf() end end }) end
Which I have as the touch handler of a rectangle. When I touch the rectangle, the fade works but when it tries to call removeSelf(), I get an error about trying to call removeSelf on a nil value. However, it obvious that event.target exists because otherwise the call to removeSelf would be skipped.
Any ideas?