Easing in and out of scroll

I’ve created a page that contains 3 different movie clips that scroll left and right in respose to the mouse. They each move at different rates and create a parallax effect. My question is how do I ease the movie clips in and out of their stop positions? At the moment they all run full speed in and out of a stop.

Here is what I have so far:

In frame one:

center = 320;
reelPos = reel._x;
leftStop = -100;
rightStop = 45;

objPos = objects._x;
objleftStop = -600;
objrightStop = 110;

In frame two:

// posts controller
reelSpeed = (_xmouse-center)/70;
reelPos = Math.round (reelPos-reelSpeed);
if (reelPos reelPos = leftStop;
}
if (reelPos>rightStop) {
reelPos = rightStop;
}
reel._x = reelPos;

// objects controller
objSpeed = (_xmouse-center)/15;
objPos = Math.round (objPos-objSpeed);
if (objPos objPos = objleftStop;
}
if (objPos>objrightStop) {
objPos = objrightStop;
}
objects._x = objPos;

This is then looped to create the movement. Can anyone offer some suggestions?

Wow your if statements above are messed up.

Try putting your code between [ PHP ] [ /PHP ] tags (without spaces) for it to work without converting anything to html accidentally or something, because right now it doesn’t work even when I do fix it so I need the original code.

Sorry, lets try this again. Frame two should read like this:


// posts controller
reelSpeed = (_xmouse-center)/70;
reelPos = Math.round (reelPos-reelSpeed);
if (reelPos<leftStop) {
  reelPos = leftStop;
}
if (reelPos>rightStop) {
  reelPos = rightStop;
}
reel._x = reelPos;
  
// objects controller
objSpeed = (_xmouse-center)/15;
objPos = Math.round (objPos-objSpeed);
if (objPos<objleftStop) {
  objPos = objleftStop;
}
if (objPos>objrightStop) {
  objPos = objrightStop;
}
objects._x = objPos;


I tried creating an empty movie clip adding the event handler, onClipEvent(enterFrame) to help control the movments, but that wasn’t working properly and I don’t know if thats the best approach anyway.

I can’t seem to get it if there is :frowning:

Sorry.