I am currently working with storyboard and have managed to implement display.newText and display.newImage objects to my display group (“self.view”, nicknamed “group”).
Then I found out that using “group:insert” on such objects enters them into a numbered array for the display group, and does not maintain their name as an index of that group.
For example, I would like to be able to insert a display.newImage object called “newCard” and then be able to reference it later by using “group.card”.
I have tried:
[lua]
local newCard = display.newImage( imageDirectory )
group.card = newCard
[/lua]
as opposed to
[lua]
local newCard = display.newImage( imageDirectory )
group:insert( newCard )
[/lua]
However newCard does not function in the display group properly when this is done using the first example. The second example works of course, but does not allow me to reference that object by named index, only by array position/number.
I have read the following documents:
http://docs.coronalabs.com/guide/media/displayObjects/index.html
http://developer.coronalabs.com/content/application-programming-guide-graphics-and-drawing
And although they discussed similar topics, I feel they did not adequately explain this specific issue. Any help (main question in bold above) would be much appreciated!!!