Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
04-24-2009, 10:46 AM #1
- Join Date
- Apr 2009
- Thanked 0 Times in 0 Posts
Access sub-child of a MC symbol without using dot operator
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.