Open GoogleCodeExporter opened 9 years ago
When AS3 function wrapper on Lua function is created, we store lua_State of
current
coroutine with it, but we must store the main lua_State instead. The workaround:
print = as3.makeprinter(output)
local main
local continue = as3.toas3(function()
assert(coroutine.resume(main))
end)
main = coroutine.create(function()
local loader = as3.class.flash.net.URLLoader.new()
loader.addEventListener(
as3.class.flash.events.Event.COMPLETE,
continue,
false, 0, true
)
loader.load(as3.class.flash.net.URLRequest.new("http://example.com/"))
coroutine.yield()
print(as3.tolua(loader.data))
end)
assert(coroutine.resume(main))
Original comment by aglad...@gmail.com
on 15 Feb 2009 at 7:15
Original comment by aglad...@gmail.com
on 11 May 2010 at 9:57
Original issue reported on code.google.com by
aglad...@gmail.com
on 15 Feb 2009 at 8:55Attachments: