I tested this but had problems with some other codes that I used on every page.
I found a way move to another fram with this code:
function randNum(nMin, nMax) {
return Math.round(Math.random() * (nMax - nMin)) + nMin;
}
/////
this.onEnterFrame = function(){
s=new Sound();
s.attachSound("knack");
s.start();
_root.gotoAndStop("go" + randNum(1, 6));
}

Can You add something to this so that You don´t come back to the last fram you just came from. It´s ok if you get back to the same frame later on but to avoit getting the same randomframe after it self.
Can that be done?

/Mattias