# Start on random frame

**URL:** <https://forum.kirupa.com/t/start-on-random-frame/276436>\
**Category:** flash\
**Created:** [November 27, 2008, 11:16am UTC](https://forum.kirupa.com/t/start-on-random-frame/276436 "2008-11-27T11:16:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![izzie](https://avatars.discourse-cdn.com/v4/letter/i/4491bb/32.png) [@izzie](https://forum.kirupa.com/u/izzie)\
**Post date:** [November 27, 2008, 11:16am UTC](https://forum.kirupa.com/t/start-on-random-frame/276436/1 "2008-11-27T11:16:48Z")

</div>

Can anyone please help me with getting the correct code in AS3 for starting a swf-file on a random frame? In my file, it should randomly start on frame 2 or 3.

I found a code for AS2, which is

```auto
 
function randRange(min, max){   
var randomNum= Math.round(Math.random()*(max-min))+min;   
return randomNum; } 
{     
var say; say = randRange(2,3); gotoAndStop(say); 
}

```

It works in IE, but not in Firefox and Netscape by some reason.  
And anyway, I need it in AS3.

Please help!
