As far as changing the position of an object in a group, you can simply use the remove() and insert() methods:
local obj1 = aGroup:remove(1)
local obj2 = aGroup:remove(1)
aGroup:insert( obj2 )
aGroup:insert( obj1 )
In the above code, I have a group with two objects. I use remove and insert to swap their positions.
Of course, I could have written the example more simply like this:
local obj1 = aGroup:remove(1) -- Remove obj from position 1
aGroup:insert( obj1 ) -- Put at end of group (last position)
Lastly, if you want to reference an object that is in a group you can simply do this:
aGroup[2].x = 100 -- Change x attribute of object in 'aGroup' at position 2 to 100
http://developer.coronalabs.com/reference/index/groupremove
http://developer.coronalabs.com/reference/index/groupinsert
Cheers,
Ed
Roaming Gamer, LLC.
SSK for Corona SDK (github) (videos) [import]uid: 110228 topic_id: 31966 reply_id: 127485[/import]