# Script block

**URL:** <https://forum.kirupa.com/t/script-block/180840>\
**Category:** Uncategorized\
**Created:** [March 3, 2006, 7:39pm UTC](https://forum.kirupa.com/t/script-block/180840 "2006-03-03T19:39:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aBnest](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/abnest/32/2177_2.png) [@aBnest](https://forum.kirupa.com/u/aBnest)\
**Post date:** [March 3, 2006, 7:39pm UTC](https://forum.kirupa.com/t/script-block/180840/1 "2006-03-03T19:39:45Z")

</div>

i am trying to make a movie clip move continuously in a random way on a bar/

for(i=0; i \< 1600; i++){

```
aiurea = -10 + Math.floor(Math.random() * 20);
if (light._y &lt; Stage.height){
    this.light.tween("_y", light._y, airuea*500 , aiurea);
    trace(aiurea);
}
else{
    light._y=0;
    trace("dincolo");
}

```

}

i know my code is wrong. and i have the wrong aproach .but i am new to this and this is the best i come up with.

can i get some hints on how to do this ??
