# Generating then removing randomness in movieclip

**URL:** https://forum.kirupa.com/t/generating-then-removing-randomness-in-movieclip/306839
**Category:** flash
**Created:** [March 23, 2010, 10:22am UTC](https://forum.kirupa.com/t/generating-then-removing-randomness-in-movieclip/306839 "2010-03-23T10:22:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![eurogibbon](https://avatars.discourse-cdn.com/v4/letter/e/919ad9/32.png) [@eurogibbon](https://forum.kirupa.com/u/eurogibbon)
#### Post date: [March 23, 2010, 10:22am UTC](https://forum.kirupa.com/t/generating-then-removing-randomness-in-movieclip/306839/1 "2010-03-23T10:22:54Z")

</div>

Hi all,

I’ve created a movieclip for the homepage of a website. It is a series of images that are displayed in sequence.

However, I needed the movieclip to start at a random place when the page loads, so I used:

gotoAndPlay (random (1465));

on the 1st frame, which works fine. The problem is that once the movie reaches frame 1465 (the end) it jumps to a random frame again, instead of looping back to frame 1 as I would like.

How do I cancel the random frame function after its 1st use?

Cheers
