View Full Version : How do I Jump frames..
youkou-chan
04-24-2009, 04:27 AM
Okay, for example. I want it so when you click a certain button on frame 5, it either jumps to frame 14, 15, or 16. How can I do this??:confused:
Is it even possible?
Jobless
04-24-2009, 04:34 AM
What do you mean by either? Randomly to 14, 15 or 16?
kkbbcute
04-24-2009, 08:05 AM
Check this out:
http://www.flashcs.org/random-number-within-a-range/
cjx3711
04-27-2009, 06:18 AM
gotoAndPlay (Math.round(Math.random() * (2) + 14))
kkbbcute
04-27-2009, 10:42 AM
Hey, cjx3711, use [AS] tags when you post. ;)
Anyway, you might want to use Math.floor instead of Math.round for some circumstances. Math.floor, well, rounds down your number to the last integer before that.
BikutaHo
05-06-2009, 04:24 PM
You mean like the button thing? when you click it, it brings you to different frames?
All you have to do is
do the button script
neilmmm
05-06-2009, 06:26 PM
this would send it and stop at randomFrame 14 - 16
var targetFrame:Number=Math.floor(Math.random()*3)+14;
gotoAndStop(targetFrame);
kkbbcute
05-07-2009, 11:43 AM
Also, if you intend to change and add frames later on, you might want to use frame labels instead of the actual frame number.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.