Flash 8 Random Navigation

Dear people

I’m trying to set-up a simple random navigation using labels and an array that jumps to different points in the timeline. I’ve used a simple onpress handler to initiate. As far as I can figure this should work, however I only ever get one random selection. If I press the button again the playback head does not jump to a new random location. What am I missing here that is obvious?

p.s. thanks for the random sound tips.

julie
xx




labelarray=["blob","blob_0","blob_1","blob_2", "blob_3"];


// calculate a random index for this array
random_anms = random(labelarray.length);

button_mc.onPress = function() {
// jump to the label at the random index
gotoAndStop(labelarray[random_anms]);

}