# Current position to a new one?

**URL:** <https://forum.kirupa.com/t/current-position-to-a-new-one/114213>\
**Category:** Uncategorized\
**Created:** [June 25, 2004, 11:38pm UTC](https://forum.kirupa.com/t/current-position-to-a-new-one/114213 "2004-06-25T23:38:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HeeT](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@HeeT](https://forum.kirupa.com/u/HeeT)\
**Post date:** [June 25, 2004, 11:38pm UTC](https://forum.kirupa.com/t/current-position-to-a-new-one/114213/1 "2004-06-25T23:38:52Z")

</div>

This is a little tricky to explain, so here it goes…

Basically, I have three tabs, the rollout and rollover work perfect, I’m using this code to make transition from over and out smooth:

On the button:

> 

on (rollOver) {  
portfolio.goBack = false;  
portfolio.play();  
}  
on (rollOut) {  
portfolio.goBack = true;  
}  
on (press) {  
[portfolio.gotoAndStop(51);  
}

On frame one:

> 

MovieClip.prototype.rewind = function () { if (goBack && (\_currentframe\>1)) {gotoAndStop (\_currentframe-1);}};

And on the movie clip:

> 

onClipEvent (enterFrame) {  
this.rewind();  
}

Inside the movie clip, has a bunch of tweens, and on frame one I declare the variable and get the y position of another movie clip (the one that is moving in the tweens) It’s instance name is portfolio\_graph.  
On frame 1:

> 

var y\_portfolio; // y position of the movie clip that I’m tweening  
y\_portfolio = portfolio\_graph.\_y;

And on frame 51 is where it should go when it’s pressed.

> 

// Y Starting point  
hosting\_graph.\_y = y\_hosting;  
// Y Ending point  
endPosy = -31.8;  
// X Start  
hosting\_graph.\_x = -52.1;  
// Speed of decel  
accelFactor = 10;  
currentPosy = hosting\_graph.\_y;  
diffPosy = endPosy-currentPosy;  
accely = diffposy/accelFactor;  
hosting\_graph.\_y = hosting\_graph.\_y+accely;

Ok, now the problem.

When I press, it disapears the first time. When I do move my mouse over another button ( each button affects the other two ) portfolio\_graph moves to roughly -17 ( eye-balled it )… actually looking at it again, it looks like its playing from halfway through the animation and in reverse. Hmmm.

Did I go wrong in the code somewhere? If the .fla would help, I’ll give it to you, no problem. Thanks in advance,

Anton Doos 🍺
