# Go to random frame

**URL:** <https://forum.kirupa.com/t/go-to-random-frame/2901>\
**Category:** Uncategorized\
**Created:** [March 14, 2002, 4:14pm UTC](https://forum.kirupa.com/t/go-to-random-frame/2901 "2002-03-14T16:14:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2002, 4:14pm UTC](https://forum.kirupa.com/t/go-to-random-frame/2901/1 "2002-03-14T16:14:04Z")

</div>

ok say i’m making a game, and when you press the start button, i want Flash to go to a random frame say frames 2-10 would a code like this work?\r\ron (release){\rgotoAndPlay (\_currentframe+x)\r}\r\r\rand then in the timeline (frame1) have a code\r\rx=Math.random(10)\r\r

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2002, 4:27pm UTC](https://forum.kirupa.com/t/go-to-random-frame/2901/2 "2002-03-14T16:27:21Z")

</div>

that code should work, have you tried it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2002, 6:51pm UTC](https://forum.kirupa.com/t/go-to-random-frame/2901/3 "2002-03-14T18:51:38Z")

</div>

i haven’t tried it because my harddrive has nothing on it. I have to reinstall windows 98 and then upgrade the \*\*\*\*\* to XP. then reinstall Flash and then I will try it. I was just making sure so I could get right to work wheni get my computer back.
