Random chanseing frames

I made something but it wont work maybe its all wrong

gotoAndPlay(case);
**case 0: **
gotoAndPlay(21);
**case 1: **
gotoAndPlay(41);
**case 2: **
gotoAndPlay(61);
**case 3: **
gotoAndPlay(1);

Well i want to change frame after every 20 frames randomly.

You didn’t give much to go on, try to be more specific when posting so you can get the best help possible.

Maybe this will help:

  1. make a movie clip with 20 frames on it. make the 20th frame a keyframe with this action:

_root.gotoAndPlay(random(x));

or if you are trying to get a seperate movie clip to play randomly use this action:

_root.myOtherMovie.gotoAndPlay(random(x));

And replace the x with whatever the total number of frames there are in the movie you are targeting.

Good luck.

It didnt work.