View Full Version : Access sub-child of a MC symbol without using dot operator

04-24-2009, 11:46 AM
Can any tell me how can I access a sub-child of a MoivieClip using [ ] operator?
The MovieClip 'myMovieClip' has 5 children:- 'child1', child2', ..., 'child5'. Now each child has a sub-child.
'child1' has 'sub1' as its child.
'child2' has 'sub2' as its child.
'child5' has 'sub5' as its child.
I was able to access the children of 'myMovieClip' as:- myMovieClip["child"+i]
where 'i' is a variable from 1 to 5.
But I don't know how to access the sub-child 'sub1', sub2' by this method.
I tried it as follows: myMovieClip["child"+i]["sub"+i]
It didn't work.
I don't want to access it as:- 'myMovieClip.child1.sub1' for each sub-child as this would not be the best way.
There has to be some way out to access those sub-children without dot operator.
Please help.