# Random movie in a Flash file probs

**URL:** https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401
**Category:** Uncategorized
**Created:** [August 1, 2003, 10:49pm UTC](https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401 "2003-08-01T22:49:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![wet\_hot\_america](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@wet\_hot\_america](https://forum.kirupa.com/u/wet_hot_america)
#### Post date: [August 1, 2003, 10:49pm UTC](https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401/1 "2003-08-01T22:49:23Z")

</div>

I’m trying to place a movie clip in a Flash animation but have it appear randomly. It is a tree moving past the moon. I want it to seem real, so having it constantly move in a repeated pattern would not be good. Any help would be greatly appreciated.

---

<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: [August 1, 2003, 10:53pm UTC](https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401/2 "2003-08-01T22:53:28Z")

</div>

shouldn’t the moon move past the tree?

---

<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: [August 2, 2003, 2:09am UTC](https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401/3 "2003-08-02T02:09:05Z")

</div>

> \*Originally posted by DigitalPimp \*  
> \*\*shouldn’t the moon move past the tree? \*\*

you always have to have a smart \*\*\* remark about everything don’t you?

could you post an fla? also you might try something like this:

```auto

with(_root.movieclipname){
_x = Math.ceil(Math.random()*100);//100 is the max x can be
_y = Math.ceil(Math.random()*100);//100 is the max y can be
onEnterFrame = function(){
_x += 0;//adjust these for your movement
_y +=3;//adjust these for your movement
};
}

```

---

<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: [August 2, 2003, 2:51pm UTC](https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401/4 "2003-08-02T14:51:17Z")

</div>

i could have the moon pass the tree, but the view is from inside of a car traveling down the road. thanks for your interest though. the script given does seem to do the trick, so… thanks.

---

<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: [August 2, 2003, 6:58pm UTC](https://forum.kirupa.com/t/random-movie-in-a-flash-file-probs/27401/5 "2003-08-02T18:58:13Z")

</div>

> \*Originally posted by wet hot america \*  
> \*\*i could have the moon pass the tree, but the view is from inside of a car traveling down the road. thanks for your interest though. the script given does seem to do the trick, so… thanks. \*\*

NP :beam:
