# What is the difference?

**URL:** https://forum.kirupa.com/t/what-is-the-difference/78693
**Category:** random
**Created:** [February 7, 2005, 1:50pm UTC](https://forum.kirupa.com/t/what-is-the-difference/78693 "2005-02-07T13:50:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)
#### Post date: [February 7, 2005, 1:50pm UTC](https://forum.kirupa.com/t/what-is-the-difference/78693/1 "2005-02-07T13:50:12Z")

</div>

Well I was making one of these smooth slidebars.  
First I applied this code to time line:

function(targetx, speed) {  
currentpos = this.\_x;  
this.\_x += (targetx-currentpos)/speed;  
};

and this to buttons:  
on (rollover) {  
\_root.bar.move (0, 5);  
}

AND ??? It didnt work out.  
Then with spending sometime in the flash help I found and applied this:

MovieClip.prototype.move = function(targetx, speed) {  
this.onEnterFrame = function() {  
currentpos = this.\_x;  
this.\_x += (targetx-currentpos)/speed;  
};  
};

but I dont know why I did it like that.  
Can anyone please explain me the exact difference between those 2 and this prototype stuff ?  
Thanks
