# Random Number Generator/Scene

**URL:** <https://forum.kirupa.com/t/random-number-generator-scene/107337>\
**Category:** Uncategorized\
**Created:** [April 14, 2004, 2:41pm UTC](https://forum.kirupa.com/t/random-number-generator-scene/107337 "2004-04-14T14:41:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stermer](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stermer](https://forum.kirupa.com/u/stermer)\
**Post date:** [April 14, 2004, 2:41pm UTC](https://forum.kirupa.com/t/random-number-generator-scene/107337/1 "2004-04-14T14:41:46Z")

</div>

ok, so i have this movie. i have three scenes in it. and i wanna make it so the first scene randomly selects a number so it can jump to either scene 2 or 3. so everytime it loads the page it will go to either one of those randomly. i can easily do this buy loading external swfs and getting it to work, however jumping to a random scene in the movie doesn’t seem to work right. here’s my code, anyone know what i’m doing wrong? am i missing something simple?

Num = Math.random();  
Num = Math.round(Num);  
if (Num == 0) {  
gotoAndPlay(“Scene\_2”, 1);  
}else if (Num == 1) {  
gotoAndPlay(“Scene\_3”, 1);  
}
