Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Attempt to index local 'output' (a nil value) when downloading an image — Gideros Forum

Attempt to index local 'output' (a nil value) when downloading an image

DarkPixelDarkPixel Member
edited September 2012 in Bugs and issues
Hey guys, this is a strange error, cause yesterday it worked pretty well, but suddenly started showing this error.
This is the part of my code that creates this error:
 local loader = UrlLoader.new(URL)
 
  function onComplete(event)
   info:setText("done")
 
	local output = io.open("temp.png", "w+") -- I also tried it with "wb" but the same error shows up
	output:write(event.data) -- Error shows up in this line	
	output:close()
 
-- Bitmap that shows up in the middle
 
	local pic = bitmap.new(Texture.new("temp.png"))
	pic:setAnchorPoint(0.5, 0.5)
	pic:setPosition(width/2, height/2 - 100)
	pic:setScale(0.96,0.96)
        stage:addChild(pic)
 
end
This is the error: attempt to index local 'output' (a nil value)

Comments

Sign In or Register to comment.