Unable to access stages children

As I create display objects, the stages ‘numChildren’ count increases as expected but I seem to be unable to access the children:

print( display.getCurrentStage().numChildren ) -- outputs '0'  
display.newRect(...)  
print( display.getCurrentStage().numChildren ) -- outputs '1'  
print( display.getCurrentStage()[1] ) -- outputs 'nil' ???  

I know the stage group is a special type of group object, so is the above expected behavior or is there a bug somewhere?

Thanks [import]uid: 1581 topic_id: 310 reply_id: 300310[/import]

i noticed the same thing…as a workaround i created a group under the current stage that serves as my “real” root object and make sure everything else is inserted into this object or somewhere in the tree below…

seems like a bug though [import]uid: 4044 topic_id: 310 reply_id: 493[/import]

You are correct, this is a bug. Good catch! You can temporarily work around this by adding objects to a group and then accessing the children in that group. [import]uid: 5 topic_id: 310 reply_id: 495[/import]