Linking Buttons with MCs

I’m having trouble figuring how to get the buttons to reference the correct imageBox and position the imageHolder. The imageHolder is a movieclip on the main stage and inside of that are a series of imageBoxes attached for each image. You can click on each image and the imageHolder will move and the images will enable and disable. If you click on a button the current image will fade but then return to 100% alpha. It’s not completing the disableImages function.

You can view a swf of it HERE. Probably viewing it will be better than anything I can describe.

This is the actionscript for enabling and disabling images and for positioning the imageHolder:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]function[/COLOR] disableImagesCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR]; i<imageTotal; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
imageHolder[COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]enabled[/COLOR] = [COLOR=#000000]false[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]//[/COLOR]
[COLOR=#000000]var[/COLOR] whereTo:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]imageHolder[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+p[COLOR=#000000]][/COLOR].[COLOR=#0000FF]_x[/COLOR]+COLOR=#000000[/COLOR];
TweenLite.[COLOR=#000080]to[/COLOR][COLOR=#000000]([/COLOR]imageHolder, [COLOR=#000080]0[/COLOR].[COLOR=#000080]75[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#0000FF]_x[/COLOR]:COLOR=#000000[/COLOR]-whereTo, onComplete:currentImg[COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]

[COLOR=#000000]function[/COLOR] currentImgCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR]; i<imageTotal; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]i == p[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#808080]//image selected[/COLOR]
imageHolder[COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]enabled[/COLOR] = [COLOR=#000000]false[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“sortDetail IF”[/COLOR][COLOR=#000000])[/COLOR];
TweenLite.[COLOR=#000080]to[/COLOR][COLOR=#000000]([/COLOR]imageHolder[COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+p[COLOR=#000000]][/COLOR].[COLOR=#000080]image[/COLOR], [COLOR=#000080]0[/COLOR].[COLOR=#000080]5[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#0000FF]_alpha[/COLOR]:[COLOR=#000080]100[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR] [COLOR=#0000FF]else[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#808080]//image not selected[/COLOR]
imageHolder[COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]enabled[/COLOR] = [COLOR=#000000]true[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]

Actionscript for creating the Buttons and whatnot:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]function[/COLOR] createImagesCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR]; i<imageTotal; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#000000]var[/COLOR] img = [COLOR=#0000FF]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“image”[/COLOR]+i[COLOR=#000000]][/COLOR] = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]Object[/COLOR]COLOR=#000000[/COLOR];
img.[COLOR=#000080]id[/COLOR] = i;
img.[COLOR=#000080]path[/COLOR] = xmlRoot.[COLOR=#0000FF]childNodes[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]attributes[/COLOR].[COLOR=#000080]path[/COLOR];
img.[COLOR=#000080]w[/COLOR] = [COLOR=#000080]0[/COLOR];
img.[COLOR=#000080]h[/COLOR] = [COLOR=#000080]0[/COLOR];
[COLOR=#808080]//[/COLOR]
[COLOR=#000000]var[/COLOR] t = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]imgNum[/COLOR].[COLOR=#0000FF]duplicateMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“imgNum”[/COLOR] + i, i[COLOR=#000000])[/COLOR];
t.[COLOR=#000080]toolImg[/COLOR] = xmlRoot.[COLOR=#0000FF]childNodes[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]attributes[/COLOR].[COLOR=#000080]thumb[/COLOR];
t.[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“imgNum”[/COLOR] + COLOR=#000000[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000FF]_x[/COLOR] + [COLOR=#0000FF]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“imgNum”[/COLOR] + COLOR=#000000[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000FF]_width[/COLOR] + [COLOR=#000080]4[/COLOR];
t.[COLOR=#000080]num_txt[/COLOR].[COLOR=#0000FF]text[/COLOR] = i+[COLOR=#000080]1[/COLOR];
t.[COLOR=#0000FF]onRollOver[/COLOR] = over;
t.[COLOR=#0000FF]onRollOut[/COLOR] = out;
t.[COLOR=#0000FF]onPress[/COLOR] = released;
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]//[/COLOR]
infoBox.[COLOR=#0000FF]text[/COLOR] = [COLOR=#FF0000]“Loading XML…”[/COLOR];

[COLOR=#000000]function[/COLOR] overCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
tooltip.[COLOR=#000080]imgTip[/COLOR].[COLOR=#0000FF]loadMovie[/COLOR]COLOR=#000000[/COLOR];
tooltip.[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_x[/COLOR] + [COLOR=#000080]3[/COLOR];
tooltip.[COLOR=#0000FF]_y[/COLOR] = [COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_y[/COLOR] + [COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_height[/COLOR][COLOR=#000000])[/COLOR]-[COLOR=#000080]5[/COLOR];
tooltip.[COLOR=#0000FF]_visible[/COLOR] = [COLOR=#000000]true[/COLOR];
[COLOR=#000000]}[/COLOR]

[COLOR=#000000]function[/COLOR] outCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
tooltip.[COLOR=#0000FF]_visible[/COLOR] = [COLOR=#000000]false[/COLOR];
[COLOR=#000000]}[/COLOR]

[COLOR=#000000]function[/COLOR] releasedCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
TweenLite.[COLOR=#000080]to[/COLOR][COLOR=#000000]([/COLOR]imageHolder[COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+p[COLOR=#000000]][/COLOR].[COLOR=#000080]image[/COLOR], [COLOR=#000080]0[/COLOR].[COLOR=#000080]5[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#0000FF]_alpha[/COLOR]:[COLOR=#000080]20[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];
disableImagesCOLOR=#000000[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"imgHOL = "[/COLOR] + imageHolder[COLOR=#000000][[/COLOR][COLOR=#FF0000]“imageBox”[/COLOR]+p[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"RELEASED = "[/COLOR] +[COLOR=#0000FF]this[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]

Thanks :slight_smile: