It looks like you're new here. If you want to get involved, click one of these buttons!
require("json") signUp = Core.class(Sprite) --JsonData For SignUp local data = { mode = "registerUser", emailId = txtemail, username = txtUsername, password = txtpwd } function signUp:onComplete(e) print("done") local t = json.decode(e.data) for k,v in pairs(t) do print(k,v) end sceneManager:changeScene("login", 1, SceneManager.fade, easing.linear) end function signUp:onError(e) print("error"..e.error) end function signUp:onProgress(event) print("progress: " .. event.bytesLoaded .. " of " .. event.bytesTotal) end function signUp:onMouseDown(event) if btn_done:hitTestPoint(event.x, event.y) then --Json Call body = json.encode(data) local url="url" local loader = UrlLoader.new(url,UrlLoader.POST,body) loader:addEventListener(Event.COMPLETE, self.onComplete,loader) loader:addEventListener(Event.ERROR, self.onError,loader) loader:addEventListener(Event.PROGRESS, self.onProgress,loader) end end |
Comments
the modified code is as follows:
Likes: ar2rsawseen, Sarthak