River City Ransom

I’m trying to recreate River City Ransom in flash, and I’m not having the best of luck. :frowning: http://mediamax.streamload.com/makarman/Hosted/River%20City%20Ransom%20Marathon.fla Look at the intervals kicktimer and kicktimer2. Kicktimer is a setInterval() function applied to the player movie clip. When certain areas are clicked (the background and the enemy), the player movie clip becomes invisible and the kicking movie clip becomes visible. This makes the player appear to be kicking. The kicktimer setInterval() function makes the player movie clip become visible again and the kicking movie clip become invisible. It then clears the kicktimer interval. The kicktimer2 setInterval() function is the problem. Look at the actions applied to the enemy1 movie clip. 8% of the time when the player movie clip is near the enemy movie clip, the enemy1 movie clip is set to become invisible and the enemykicking movie clip become visible. The kicktimer2 setInterval() function makes the enemy1 movie clip become visible again and the enemykicking movie clip become invisible after waiting 249.9 milliseconds (three frames, the length of the enemykicking animation). It then clears the kicktimer2 interval. Sometimes, the kicktimer2 setInterval() function will be called more than once within 249.9 milliseconds. This causes the interval to not be cleared. How would I prevent this from happening? I appreciate your time.