Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
onError() - Gideros Forum

onError()

CyberienceCyberience Member
edited April 2013 in Bugs and issues
Int he Event.ONERROR how does one get the information of the error? I tried adding event in the parameter, but no result.

Regards
REAL programmers type copy con filename.exe
---------------------------------------

Comments

  • are you asking about urlloader??

    this is the what i found in example
     
    local loader = UrlLoader.new("<a href="http://example.com/image.png&quot" target="_blank" rel="nofollow">http://example.com/image.png&quot</a><img class="emoji" src="/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

    :)
  • atilimatilim Maintainer
    And yes, we don't provide error code or error information on Event.ERROR event of UrlLoader.
  • yes oneerror was a typo.....
    So probably some assumption could be made here, such as, if an error, then retry...
    REAL programmers type copy con filename.exe
    ---------------------------------------
Sign In or Register to comment.