# Random moyion tute

**URL:** <https://forum.kirupa.com/t/random-moyion-tute/23470>\
**Category:** Uncategorized\
**Created:** [June 18, 2003, 12:20pm UTC](https://forum.kirupa.com/t/random-moyion-tute/23470 "2003-06-18T12:20:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmokyD](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@SmokyD](https://forum.kirupa.com/u/SmokyD)\
**Post date:** [June 18, 2003, 12:20pm UTC](https://forum.kirupa.com/t/random-moyion-tute/23470/1 "2003-06-18T12:20:26Z")

</div>

i’ve just completed the random motion tutorial and since it was basically just cut and oasting code i figured not much could go wrong but… all my little graphic does is JUMP randomly around the screen. not with nice little tweening type motion??  
any ideas…anyone???  
thankyou  
brad

---

<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:** [June 18, 2003, 12:31pm UTC](https://forum.kirupa.com/t/random-moyion-tute/23470/2 "2003-06-18T12:31:38Z")

</div>

If I get your question correctly then maybe you can do something with this? Hopefully it helps :geek:

[edit]  
Erh seems something went wrong with the file?! _gasp_

Anyhow,

I created a movieclip with a dot which had a simple tween effect with an alpha which makes it invisible at the end. At the end frame of this movieclip I also added a bit of script:  
[AS]\_root.rndMove = 1;[/AS]

On the root of the movie itself I added the movieclip and gave it really easy code:  
[AS]onClipEvent(enterframe){  
if(\_root.rndMove == 1){  
\_x = random(200);  
\_y = random(200);  
\_root.rndMove = 0;  
}  
}[/AS]  
The 200’s where my width and height of the movie.

Hope this helps.  
[/edit]

:geek:

---

<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:** [June 18, 2003, 7:31pm UTC](https://forum.kirupa.com/t/random-moyion-tute/23470/3 "2003-06-18T19:31:00Z")

</div>

Theres 2 random motion tutorials here, one for Flash 5 and one for Flash MX. Make sure you got the right one.
