Hover Captions with easing

Hi there, I read the hover captions tutorial and got mine to work, along with adding a telltarget to have th movie fade in, but now I’d like to have it ease like how it does in this tutorial.

http://www.kirupa.com/developer/mx/followease.htm

when I impliment that code with the catption code the mouse moves to the bottom right of the screen when I mouse over the target

here’s what I have

Caption

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
if (_root.x == 1) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
this._alpha = 100;
} else {
this._alpha = 0;
}
}

Target Button

on (rollOver) {
_root.x = 1;
caption.words = “click for large image”;
}
on (rollOut) {
_root.x = 0;
caption.words = " ";
}
on (release) {
loadMovieNum(“movies/fader.swf”, 199);
loadMovieNum(“movies/popup_1.swf”, 200);
}
on (rollOver) {
startDrag(caption, true);
tellTarget (“caption”) {
gotoAndPlay(“Fade Up”);
}
}

When I run your code, the caption moves from the top left of the screen to the button. When I move off of the button, it disappears but the caption does not go back to the top left.

Do you want it to move back to the top left?
And why do you have Two on (rollOvers)s?

The else, where x = 0, it doesn’t tell it to go back to start… just tells it’s alpha to equal 0…

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
if (_root.x == 1) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
this._alpha = 100;
} else {
_x += (0-_x)/speed;
_y += (0-_y)/speed;
if (_x == 0) {
this.alpha = 0;
}
}
}

Thank you for your help but, I tried that and that didn’t work either. :frowning:

I will try to post an .fla so you can see fist hand what the code is trying to do.

You could just upload it on here with the attach file option.

Ok here’s the file, as you see right now the hover buttons are acting normal and that’s cool, but now they need to have some easing when they follow the mouse. Or elasticity or physics or whatever would be simple and easy to do. :slight_smile:

www.radiofreetokyo.com/popup_2.zip

I’m thinking that maybe the code is getting messed up because of the drag function on either the hover caption its self or the drag function on the buttons to move the box around the screen

Sorry for not checking it out sooner. I just got back from a friend’s house. I will check it out now…

You want the button to easy toward the mouse? The Caption or the Window thing where the four images are displayed?

I’d like the caption on the buttons to ease towards the mouse

bump :slight_smile: