Hello people...

I'm creating a game where I need the speed of certain movie clips to speed up or slow down depending on what the player collides with or picks up. To do this I altered the value of a variable 'n' on collision etc... and then used the following script in the timeline:

if (n+_currentframe<=40) {
gotoAndPlay(_currentframe+n);
}
if (n+_currentframe>40) {
gotoAndPlay((_currentframe+n)-40);
}

I've used the IF statement as my MC is a 40 frame loop so need the clip to jump to the corresponding frame at the start of the loop if _currentframe+n is greater than 40.

THE PROBLEM is that this code causes flash problems (i get the dialogue box 'A script in your movie is causing flash to run slow - abort script?). I've tried using the script in 2 ways: in a key frame on every frame of my 40 frame MC and in a separate 2 frame MC with the code in the first frame and a goto in the 2nd frame (and inserting _root where appropriate). Whichever way I try I get the same problem...

Any suggestions very welcome as I'm getting a headache now...

thanks p. melons