Hey guys!
This time I’m trying to access random frames between 1 and 10. That bit’s easy, yay for help files.
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
btn.onPress = function() {
n = randRange(1,10);
gotoAndStop(n);
}
Now the problem is that I want it to visit each frame only once. So, to check this, I’ve popped a simple Boolean at the top of each frame called f1, f2, etc, but only for frames 1-5 for checking purposes. Whether it’s frames 1-5 or 1-10 doesn’t really matter at this point.
My problem is that I need to check that n against the number in my f variables. It’s easy to make a string, but how do I check that against a boolean?
frameCheck = “f”+n;
trace(frameCheck);
I keep feeling like I’ve almost got it, and then the whole concept eludes me. My immediate problem is the checking, but if anyone knows a better way to do the checking, I’d be grateful (that’s the only reason I popped it up there).
Thanks heaps!