# Random start position movieclip

**URL:** https://forum.kirupa.com/t/random-start-position-movieclip/96518
**Category:** Uncategorized
**Created:** [December 10, 2003, 11:56am UTC](https://forum.kirupa.com/t/random-start-position-movieclip/96518 "2003-12-10T11:56:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Lucremonkey](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lucremonkey/32/374_2.png) [@Lucremonkey](https://forum.kirupa.com/u/Lucremonkey)
#### Post date: [December 10, 2003, 11:56am UTC](https://forum.kirupa.com/t/random-start-position-movieclip/96518/1 "2003-12-10T11:56:09Z")

</div>

Another question beside my webshop question…

In my webshop I have 2 places where I can show special offers.  
I have 10 special offers.  
This mean that I want to display 5 offers per place.

I made a movieclip in Flash that contains all the special offers and they fade-out and in, so people get to see al of them.  
I’m now looking for a script that will make the movieclip start playing at a different advert each time a person loads the website.

So I need an couple of Actions that make the movieclip start random at either frame number 0, 24, 48, etc.

In short: a script that makes my movieclip start at one of the 5 given frames at random.

Hope I made myself clear 🙂

---

<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: [December 10, 2003, 12:02pm UTC](https://forum.kirupa.com/t/random-start-position-movieclip/96518/2 "2003-12-10T12:02:05Z")

</div>

```auto

offersperpage=5
yourMovieClip.gotoAndPlay((Math.floor(Math.random()*(offersperpage+1)))*24);

```

🙂

---

<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: [December 10, 2003, 12:07pm UTC](https://forum.kirupa.com/t/random-start-position-movieclip/96518/3 "2003-12-10T12:07:40Z")

</div>

Thanks!  
I haven’t done Flash in a while and forgot that Flash can solve a lot of problems easy as long as your being nice to 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: [December 10, 2003, 12:34pm UTC](https://forum.kirupa.com/t/random-start-position-movieclip/96518/4 "2003-12-10T12:34:41Z")

</div>

😛

No problem 😉

---

<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: [December 10, 2003, 1:30pm UTC](https://forum.kirupa.com/t/random-start-position-movieclip/96518/5 "2003-12-10T13:30:50Z")

</div>

Ok, let’s spice it up a bit:  
I want the same effect (image fades in, then fades out), but I want the images to be loaded from an external source.

How can I do this?
