Slow down and stop

Hey guys Ive got a quick question to ask, sounds like it should be easy enough.

I have some scrolling pictures going and I would like them to slow down and stop on rollover. The idea is that they wont just stop cold…

Cheers in advance for any help…

Easing to a stop is very well explained here:

http://www.kirupa.com/developer/flash8/easing.htm

that should at least get you started, if not give you the complete answer you are looking for.

Gday Adam thanks for the reply but that wasn’t really what I was after, I’m talking about slowing down the images dynamically using action script…

Basically the images are moving constantly from left to right. And when the user places the cursor over the images (doesn’t matter which one), they slow down to a stop rather than just stopping (which would be the alternative)…

Any ideas welcome… Cheers

What actionscript are you using to have the pictures scroll left to right?

no actionscript yet, i just have it moving on a timeline untill I find a way to use actionscript to get the effect I want…

You’ll have to move it with actionscript instead. It’s pretty simple, try a code like this:

var speed:Number = 5;
var origspeed:Number = speed;
var slowing:Boolean = false;
this.onEnterFrame = function(){
	if(slowing && speed > 0){
		speed -= 1;
	}
	else if(!slowing && speed < origspeed){
		speed++;
	}
	pics._x += speed;
}
pics.onRollOver = function(){
	slowing = true;
}
pics.onRollOut = function(){
	slowing = false;
}

You’ll have to move it with actionscript instead. It’s pretty simple, try a code like this:

var speed:Number = 5;
var origspeed:Number = speed;
var slowing:Boolean = false;
this.onEnterFrame = function(){
	if(slowing && speed > 0){
		speed--;
	}
	else if(!slowing && speed < origspeed){
		speed++;
	}
	pics._x += speed;
}
pics.onRollOver = function(){
	slowing = true;
}
pics.onRollOut = function(){
	slowing = false;
}