Corona SDK Storyboard: how to access the associated display group from my custom callback -
i know basics in using storyboard. created scene without problem, , added own callback (returned asynchronous http request). therefore in scene lua file, have following
local function httpcallback(data) // process data // screen update end for "screen update", don't have access associated display group, mean "self.view" in scene listeners, example,
function scene:createscene( event ) local group = self.view end how access "self.view"? thinking use variable track self.view, "asynchronous" callback, afraid self.view have become nil before find out?
what's proper way this?
thanks.
at top of storyboard module should have line:
local scene = storyboard.newscene() or similar. scene. event handlers createscene() , such passed "scene' "self". therefore can (after createscene() first called) refer scene's view (a display.newgroup intents , purposes) using code:
scene.view:insert(somedisplayobject) which means can do:
local group = scene.view and use group reference if prefer.
Comments
Post a Comment