edisonwsk / lua-alchemy

Automatically exported from code.google.com/p/lua-alchemy
0 stars 0 forks source link

as3.toas3() #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
as3.trace("aaa")
local fn = as3.new("Function", function() as3.trace(" bbb") end)
as3.call(fn, "apply")

Above would not work as Function object is not configurable.

This is needed (looks like) to be able to call removeListener on events:

f = function() some code end
as3.call(button, "addEventListener", f)
as3.call(button, "removeEventListener, f)

Those two fs would not result in the same AS object. Two separate calls to
create_callback() here.

That might work as is, but if it doesn't we could make a as3.function()
that calls the callback code and returns the AS3_Function value

Original issue reported on code.google.com by aglad...@gmail.com on 21 Dec 2008 at 9:25

GoogleCodeExporter commented 9 years ago
Generalize that with as3.toas3(param1, [... paramN]), which takes
get_as3_value_from_lua_stack() and returns it to Lua as as3 userdata.

Original comment by aglad...@gmail.com on 5 Jan 2009 at 2:21

GoogleCodeExporter commented 9 years ago

Original comment by aglad...@gmail.com on 6 Jan 2009 at 2:05