Model & Packages

What is the model and Packages? (module(…, package.seeall))

How can i create my own model. One more thing which i cannot understand is g:functionname()

What is the g exactly and how can i create my own properties?
function g:evenname( event )
– body
end [import]uid: 11038 topic_id: 3828 reply_id: 303828[/import]

that looks like it’s from the movieclip.lua file

if you read through the code then g is the display group created when the newAnim function is called and returned from the module at the end

[lua]function newAnim (imageTable)

– Set up graphics
local g = display.newGroup()

– Return instance of anim
return g
end[/lua]

g:someFunc(whatever) is the equivalent of g.someFunc(self, whatever)

it takes a while to understand and there are different ways of doing things, even in the supplied examples. Some contain functions within functions (eg movieclip.lua) whereas some are defined against the “class” object (facebook.lua)

the best thing you can do is study the modules and the way they are called from main.lua

j

[import]uid: 6645 topic_id: 3828 reply_id: 11656[/import]

What is the point here of using the g:someFunc(). and i have noticed that you have returned the g in (return g) what does that mean>

one more thing: what is the different between g:repeatFunction( event ) and calling the function it self again recursive like g:someFun()

Thanks [import]uid: 11038 topic_id: 3828 reply_id: 11677[/import]

i suggest you read through these:
http://developer.anscamobile.com/content/introduction
http://developer.anscamobile.com/content/lua-standard-libraries

they explain some of the basics of the language [import]uid: 6645 topic_id: 3828 reply_id: 11679[/import]