function does not works with array in following code:
in reference image these five are the movieclips on the stage and their instance names are same as the array items. see attachment for reference.
[LEFT][COLOR=#993300]var[/COLOR] mainBtnsArr:[COLOR=#993300]Array[/COLOR] = [COLOR=#000000][[/COLOR][COLOR=#0000FF]"chapters"[/COLOR], [COLOR=#0000FF]"projects"[/COLOR], [COLOR=#0000FF]"exercises"[/COLOR], [COLOR=#0000FF]"skills"[/COLOR], [COLOR=#0000FF]"glossary"[/COLOR][COLOR=#000000]][/COLOR];
[COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000000]0[/COLOR]; i<mainBtnsArr.[COLOR=#993300]length[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
mainBtn = mainBtnsArr[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR];
mainBtnsArr[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#993300]onPress[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"working"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
Any Help??