local loader = UrlLoader.new("<a href="http://example.com/image.png"" rel="nofollow">http://example.com/image.png"</a><img class="emoji" src="https://forum.gideros.rocks/resources/emoji/wink.png" title=";)" alt=";)" height="20" />
local function onComplete(event)
local out = io.open("|D|image.png", "wb")
out:write(event.data)
out:close()
local b = Bitmap.new(Texture.new("|D|image.png"))
stage:addChild(b)
end
local function onError()
print("error")
end
local function onProgress(event)
print("progress: " .. event.bytesLoaded .. " of " .. event.bytesTotal)
end
loader:addEventListener(Event.COMPLETE, onComplete)
loader:addEventListener(Event.ERROR, onError)
loader:addEventListener(Event.PROGRESS, onProgress)
there is nothing like Event.ONERROR and also i had never used UrlLoader
Comments
this is the what i found in example
So probably some assumption could be made here, such as, if an error, then retry...
---------------------------------------