About Inheritance in Lua

I created ObjectA.lua.
Then I created ObjectB.lua.

In ObjectB.lua::  
  
require("ObjectA")  
objB = ObjectA.createSomething();  
--Everything is Fine.  
Then in SceneA.lua  
  
require("ObjectB")  
local Obj = ObjectB.objB or ObjectB.GetInstance()  
camera:insert(Obj)  
  
--And I got the error....  
--"attempt to local index 'obj'(a nil value) "  
--"'insert'(Proxy expected, got nil)"  

I am new to lua. I wonder that lua is limit inheritance process??

[import]uid: 65906 topic_id: 15063 reply_id: 315063[/import]

you can only insert() native Corona Display Objects.

in order to create Corona Display Objects with additional features, some create one to use as their main object, then add new functionality to it by adding new properties to it dynamically.
[edit]: see this posting http://developer.anscamobile.com/forum/2011/08/07/how-inherit-coronas-display-object [import]uid: 74908 topic_id: 15063 reply_id: 56213[/import]

Thanks for your answer. I think it is more complicated to do. So, the traditional way is better for beginner like me. [import]uid: 65906 topic_id: 15063 reply_id: 56278[/import]