Easing mask?

How would I go about making an easing mask? One that sticks to a horizontal axis and follows the mouse pointer (already got that doen) but also eases before it stops, like a motion ease; slowly slowing down instead of quickly whipping to where the user moves the mouse.

what AS are you using for your easing so far?

Try this tutorial…

http://www.flashkit.com/tutorials/Actionscripting/Expert/Creating-Morten_B-540/index.php

or

http://www.flashkit.com/tutorials/Special_Effects/Physics_-Rudestar-936/index.php

One of those should help ya.

Okay, I’ll check those out when I get home…

This is the script im using on the mask so far by the way…

onClipEvent(enterFrame){
getlimits=_root.boundary.getBounds(_root);
if(_root._xmouse>=getlimits.xMin && _root._xmouse<=getlimits.xMax &&
_root._ymouse>=getlimits.yMin && _root._ymouse<=getlimits.yMax){
this._x=_root._xmouse;

 }

}

So I checked out one of those tutorials, and found this code…

myTrailer_mc.onEnterFrame = function (){
with(this){
distX = (_root._xmouse - _x);
distY = (_root._ymouse - _y);
_x += distX0.2;
_y += distY
0.2;
}
}

It works fine on an object, like a circle, or even my particular mask. But it seems to only work verticaly. For instance, if I move the mouse up and down, you can easily see that the mask is easing behind it. But from left to right, it appears to instantly snap to the mouse instead of easing.

Whats up with that?

Okay, solved more of the problem. :slight_smile:

I think it was cause i was putting the script on the object instead of the first frame.

Anyway, now i have this…

camera.onEnterFrame = function (){
getlimits=_root.boundary.getBounds(_root);
if(_root._xmouse>=getlimits.xMin && _root._xmouse<=getlimits.xMax &&
_root._ymouse>=getlimits.yMin && _root._ymouse<=getlimits.yMax){
camera._x=_root._xmouse;

camera.onEnterFrame = function (){
with(this){
distX = (_root._xmouse - _x);
distY = (_root._ymouse - _y);
_x += distX*.2;
_y += distY*.2;
}
}

}

}

Now the mask eases wherever I move it, but it comes off the horizontal axis now. It’s supposed to only be able to slide left and right along a row of pictures.

But the script that is supposed to stick it to the axis (the first half) doesnt work now that I’ve added in the easing script…