Hi there,
I’m animating this scene where a sliding On/Off switch responds to mousedrag. I have already constrained its movement to the Y-direction. But now I want to make this movieclip, called “MGAswitch”, to slide at a slower speed instead of the real-time mousedrag speed to simulate friction/resistance. How do I go about doing it?
Here’s my code:
stop();
var myBoundaries:Rectangle=new Rectangle(431,409.5,0.1,-15);
MGAswitch.addEventListener(MouseEvent.MOUSE_DOWN,dragSwitch);
function dragSwitch(event:MouseEvent):void {
MGAswitch.startDrag(false,myBoundaries);
= 1;
}
MGAswitch.addEventListener(MouseEvent.MOUSE_UP,dropSwitch);
function dropSwitch(event:MouseEvent):void {
MGAswitch.stopDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP,dropSwitch2a);
function dropSwitch2a(event:MouseEvent):void {
MGAswitch.stopDrag();
}
Thanks so much!