local jsonApp = require "mydata"; local json = require "json" jsonApp.request = "test"; jsonApp.decode = ""; local function networkListener( event ) if ( event.isError ) then print( "Network error!") else if (event.phase == "ended") then jsonApp.request = event.response; end end end -- Access Google over SSL: network.request( "http://ip.jsontest.com/", "GET", networkListener ) print (jsonApp.request);
So here’s a simple Web Request code with Json parser utilized with Corona’s own examples to not use global variables. This is all copied and pasted. My issue is jsonApp.request is becoming a local variable within the callback function networkListener and the final print is still printing “test”. I’ve been away from lua for 2 years and I never remember running into this problem in the past. Any help would be great.