Hiya, I’m using a setInterval function that will trigger an animation 5 times to reveal 5 cards. The problem is that I have a few rows of cards and if the interval is started while the previous one is still running the movie doesn’t behave normally. Obviously this is because the same counter is being used. I’m just trying to figure a way around this without writing a seperate function for each row.
Thanks for any suggestions in advance. Here’s my code:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]function[/COLOR] revealRowCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
revealRowInterval = [COLOR=#0000FF]setInterval[/COLOR][COLOR=#000000]([/COLOR]revealTheRow, revealSpeed, rowNo[COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]function[/COLOR] revealTheRowCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
revCount++;
[COLOR=#0000FF]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
revealCard[COLOR=#000000]([/COLOR][COLOR=#0000FF]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“row”[/COLOR]+[COLOR=#000080]1[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#000080]getCard[/COLOR]COLOR=#000000[/COLOR], [COLOR=#0000FF]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“card”[/COLOR]+COLOR=#000000[/COLOR][COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR] [COLOR=#0000FF]else[/COLOR] [COLOR=#000000]{[/COLOR]
revCount = [COLOR=#000080]0[/COLOR];
[COLOR=#0000FF]clearInterval[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]