Im dynamically loading external images via an XML file and creating 4 scrolling image galleries on one screen. When the user scrolls over any image, the scales are tweened and everything works…except one thing. I need the individual images to come to swap indexes to 0. I’ve tried swapChildren, swapChildrenAt, setChildIndex, etc… but i’ve come to find out that when tracing: event.target.parent.getChildIndex(event.target); I get an index number of 0 for every image, therefor, nothing can be swapped to the top. What am I missing here?.. Heres a code excerpt:
ActionScript Code:
[LEFT][COLOR=#0000FF]for[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]**var**[/COLOR] i:uint = [COLOR=#000080]0[/COLOR]; i < xmlData.[COLOR=#000080]logos[/COLOR].[COLOR=#000080]pic[/COLOR].[COLOR=#0000FF]length[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]; i++[COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
thumbLoader = [COLOR=#000000]**new**[/COLOR] Loader[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
thumbLoader.[COLOR=#0000FF]load[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]**new**[/COLOR] URLRequest[COLOR=#000000]([/COLOR] xmlData.[COLOR=#000080]logos[/COLOR].[COLOR=#000080]pic[/COLOR].[COLOR=#000080]thumb[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
thumbClip = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000FF]MovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
thumbClip.[COLOR=#000080]logoValue[/COLOR] = logoValue++;
thumbClip.[COLOR=#000080]addChild[/COLOR][COLOR=#000000]([/COLOR]thumbLoader[COLOR=#000000])[/COLOR];
thumbClip.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]MOUSE_OVER[/COLOR], overThumb[COLOR=#000000])[/COLOR];
thumbClip.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]MOUSE_OUT[/COLOR], outThumb[COLOR=#000000])[/COLOR];
thumbClip.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], showBigImage[COLOR=#000000])[/COLOR];
[COLOR=#808080]*//TweenLite.to(thumbClip, 2, {alpha:.5});*[/COLOR]
thumbClip.[COLOR=#000080]x[/COLOR] = [COLOR=#000080]95[/COLOR] * i + padding;
thumbClip.[COLOR=#000080]scaleX[/COLOR] = thumbClip.[COLOR=#000080]scaleY[/COLOR] = [COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]random[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]* .[COLOR=#000080]4[/COLOR] + .[COLOR=#000080]9[/COLOR];
thumbClip.[COLOR=#000080]rotation[/COLOR] -= [COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]random[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] * [COLOR=#000080]20[/COLOR] + [COLOR=#000080]350[/COLOR] ;
logoHolder.[COLOR=#000080]addChild[/COLOR][COLOR=#000000]([/COLOR]thumbClip[COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
and my listener:
ActionScript Code:
[LEFT][COLOR=#000000]**function**[/COLOR] overThumb[COLOR=#000000]([/COLOR]event:MouseEvent[COLOR=#000000])[/COLOR]:[COLOR=#0000FF]void[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR];
TweenLite.[COLOR=#000080]to[/COLOR][COLOR=#000000]([/COLOR]event.[COLOR=#0000FF]target[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000000]{[/COLOR]scaleX: [COLOR=#000080]1[/COLOR].[COLOR=#000080]3[/COLOR], scaleY:[COLOR=#000080]1[/COLOR].[COLOR=#000080]3[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];
event.[COLOR=#0000FF]target[/COLOR].[COLOR=#000080]parent[/COLOR].[COLOR=#000080]swapChildrenAt[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]0[/COLOR], event.[COLOR=#0000FF]target[/COLOR].[COLOR=#000080]parent[/COLOR].[COLOR=#000080]getChildIndex[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
Thanks in advance…