One more question: Is it possible to convert as3 function to lua function? Tried with as3.tolua() but it doesn't work...
public function AddEventListener(self:*, type:String, luaf:*):void
{
addEventListener(type, function(e:MouseEvent) {
luaf(e);
});
}
so basically I am passing lua function to as3 and call that function from as3 on mouse event. The problem is that the lua function is somehow converted to as3 function (or to userdata) when passed back to lua and that is causing exception in
push_as3_to_lua_stack_if_convertible()
in
bridge_as3_lua.c
I tries also passing the lua function back to lua and call it from there
as3 code:
public function AddEventListener(self:*, type:String, luaf:*):void
{
mouseEnabled = true;
addEventListener(type, function(e:MouseEvent3D) {
luaState.callGlobal("executeFunction", luaf, e)
});
}
lua code:
function executeFunction(luaf, e)
local f = as3.tolua(luaf)
f(e)
end
but I get the same result. Function is still userdata after as3.tolua()
Thanks,
Zlatko