Thanks for your interest to the LuaAlchemy!
Just expose it to Lua state as a global variable via setGlobal().
HTH,
Alexander.
On Tue, Nov 1, 2011 at 01:57, Jhon Vilkovich <myfakee...@gmail.com> wrote:
Thank you for your interest in Lua Alchemy!
> I'm creating simple class in AS3, like
> public class MyModel {
> public var _value1:int;
> public var _value2:int;
> }
>
> then I create instance and expose it to Lua, like
> lua = new LuaAlchemy("builtin://");
> lua.setGlobal("model", mymodel);
>
> the problem is that when I do type(model._value1) in lua I get
> 'table'.
> Is this a correct behaviour? I expeced a 'number' here.
Yes, it is correct. It still a boxed AS3 value. To convert it to Lua
value, use as3.tolua(), or enable sugar autoconversion feature:
https://github.com/lua-alchemy/lua-alchemy/blob/312965c1f0ac3c665c4fdbe1f1b6860f5077cd0e/HISTORY#L20
Alexander.