flsg
Member
|
well, if you have to check the points for more than once(for example, at 50 points, 200 points, 300, 500,...), I suggest you to put them in an array:
var checkValues:Array = [[50, 4], [100, "myFrameName"], [200, 29], [300, 33], [500, "win"]];
//define the array that will store the informations. The first value in the second array is the points that you need to check, the second value is the frame to play, it could be a number, a string, or a variable
var myPoints:Number = 0;
//define your points variable
myPoints += 148;
for (var i:Number = 0; i<checkValues.length; i++) {
if (myPoints>checkValues[i][0] && myPoints<checkValues[i+1][0]) {
_root.mcThatYouWantToPlay.gotoAndStop(checkValues[i][1]);
}
}
here you go, something easy to maintain if you don't understand, tell me
< Message edited by flsg -- 3/12/2007 18:40:17 >
|