Kokisho Posted December 14, 2006 Share Posted December 14, 2006 Well im trying to make a button where you press it and it gets you to a random frame between, lets say4-7, how would I go about this?Is there some command like:GotoandStop (RandomFrame)Or would I have to create a variable?Any help would be appreciated, thanks. Link to comment Share on other sites More sharing options...
smiles Posted December 15, 2006 Share Posted December 15, 2006 maybe only possible with variable function randRange(min:Number, max:Number):Number { var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min; return randomNum;}var n:Number = randRange(4,7);gotoAndStop(n); from Flash 8 Help Link to comment Share on other sites More sharing options...
Sniffy Posted December 17, 2006 Share Posted December 17, 2006 Maybe:But this would not be between 4 and 7, it would be 1 - 100; I would personally go with the above way.randomNum = int(random(100);gotoAndStop(randomNum); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now