# Continuous movement tutorial

**URL:** <https://forum.kirupa.com/t/continuous-movement-tutorial/18651>\
**Category:** Uncategorized\
**Created:** [April 19, 2003, 12:29am UTC](https://forum.kirupa.com/t/continuous-movement-tutorial/18651 "2003-04-19T00:29:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![firechild](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@firechild](https://forum.kirupa.com/u/firechild)\
**Post date:** [April 19, 2003, 12:29am UTC](https://forum.kirupa.com/t/continuous-movement-tutorial/18651/1 "2003-04-19T00:29:31Z")

</div>

I played around with the “continuous movement” tutorial for along time and was facinated by it! I fiddled w/ the code for awhile and i came up with something that i thought just maybe someone would be interested in.

first off, i got the motion to work in both directions. In doing so, i found another way to “respawn” the points to create a smoother field of dots.

instead of this line:

this.\_x = -1000

(which respawns the dot far from its ORIGINAL position) try this:

this.\_x = location - (size of movie + 20)

if you are interested here is the code that moves both ways based on a movie clip in the center called “center”, try using this modified version of the code in the tutorial:

onClipEvent (enterFrame) {  
location = this.\_x;  
var i;  
i = \_root.center.\_xmouse/10;

if (i\>0){  
if (this, hitTest(\_root.block)) {  
this.\_x = location-400;  
} else {  
this.\_x = location+i;  
}  
}

if (i\<0){  
if (this, hitTest(\_root.block2)) {  
this.\_x = location+400;  
} else {  
this.\_x = location+i;  
}  
}

}

I’m a total newb, but i learned alot from just playing around w/ that tutorial. Thanks for the great site!

---

<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:** [April 19, 2003, 12:31am UTC](https://forum.kirupa.com/t/continuous-movement-tutorial/18651/2 "2003-04-19T00:31:14Z")

</div>

maybe this should have gone under actionscripting :-\
