I believe I have everything scoped properly but am told otherwise. The error message is “attempt to index upvalue ‘customlogoImg’ (a nil value)” and my code follows:
local customlogoImg
local function loadCustomLogo()
customlogoImg = display.newImage("customlogo.png")
customlogoImg.x = display.contentCenterX -- this is where the error appears
customlogoImg.y = display.contentCenterY - 250
end
function scene:create( event )
local appSceneGroup = self.view
if (databox.customlogo == "1") then
logoIsLoaded = 0
network.download(databox.classurl .. "/img/customlogo.png", "GET", loadCustomLogo(), "customlogo.png")
end
end
The error is called on the line indicated.
Any thoughts?