Hello,
I’m having an issue with a rollover on a duplicated mc. I have a mc (circle with little squares in it), that when you click on it, it duplicates and you can drag the duplicate. I then would like to be able to be able rollover the square areas on the duplicate and have something happen. The problem is that nothing is happening when I rollover the squares (referred to as slots in the code) on the duplicate.
Here is the main code:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]var[/COLOR] tCounter:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#000080]0[/COLOR];
[COLOR=#000000]var[/COLOR] root:[COLOR=#0000FF]MovieClip[/COLOR] = [COLOR=#0000FF]this[/COLOR];
[COLOR=#000000]var[/COLOR] dup:[COLOR=#0000FF]MovieClip[/COLOR];
tArray = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]Array[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#808080]//to create tables[/COLOR]
table_mc.[COLOR=#0000FF]onPress[/COLOR]=[COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
dup = [COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]duplicateMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“table”[/COLOR] + COLOR=#000000[/COLOR], root.[COLOR=#0000FF]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];
tArray.[COLOR=#0000FF]push[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#0000FF]for[/COLOR][COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR]; i<tArray.[COLOR=#0000FF]length[/COLOR]; i++[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#808080]*//to get it to drag right away*[/COLOR]
tArray[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]startDrag[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//to get it drag each time*[/COLOR]
tArray[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]onPress[/COLOR] = [COLOR=#000000]**function**[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]startDrag[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]swapDepths[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]_root[/COLOR].[COLOR=#0000FF]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//trace (this);*[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//to stop dragging*[/COLOR]
tArray[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]onMouseUp[/COLOR] = [COLOR=#000000]**function**[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]stopDrag[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
and here is the code inside the circle mc:
ActionScript Code:
[FONT=Courier New][LEFT]slots = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]Array[/COLOR][COLOR=#000000]([/COLOR]slot1, slot2, slot3, slot4, slot5, slot6[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]i = [COLOR=#000080]0[/COLOR]; i < slots.[COLOR=#0000FF]length[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
slots[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]onRollOver[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR] [COLOR=#000000]([/COLOR]slots[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] + [COLOR=#FF0000]" has been rolled over!"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
I also attached the .fla file in case that helps. I feel like its a small fix, I just cant’t figure it out. Any help? Thanks!