Seems like a scoping issue in the code in your button. it's
simply looking for the variable randArray and frame in itself. I'm
guessing that's not where it is? If those variables are also
members of _root:
on (release) {
_root.gotoAndPlay (_root.randArray[_root.frame]);
//testing purposes:
trace (_root.randArray[_root.frame]);
_root.frame++;
}