How to handle a failed loadremoteimage call? Is it possible to assign a new image file inc ase the download fails?
Sample Code
local function networkListener( event )
if ( event.isError ) then
print ( “Network error - download failed” )
else
event.target.alpha = 0
transition.to( event.target, { alpha = 1.0 } )
if event.target ~= nil then
local myimg= event.target
myimg.name = event.response.filename
myimg.height=48
myimg.width=60
myimg.anchorX=0
groupItems:insert(myimg)
else
print("Error Loading")
end
end
end
display.loadRemoteImage(itemPhoto, “GET”, networkListener, itemID … “.jpg”, system.TemporaryDirectory,posPhotoX, posPhotoY )