Another easing question

I have an MC that contains a menu. Within the menu MC I have a little arrow movie clip that I would like to ease to the mouse position when clicked. I have this code on the little arrow, copied from many easing tutorials:

onClipEvent (load) {
_y = 0;
speed = 5;
}
onClipEvent (mouseDown) {
endY = _root._ymouse;
}
onClipEvent (enterFrame) {
_y += (endY-_y)/speed;
}

But the arrow jumps way below the mouse position when I click it.

Why?:hair:

Also, I want the arrow MC to start at a particular place. But when I put _y = 30 (for example, which is where I would want it to start from) it is still at 0,0 - even when I change _y to this._y. What the heck?

I’m having the same issue :frowning:

It sounded like Delsaber was going to fix the problem but I haven’t gotten a reply from him yet.

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25593

i use a different code,if you’d likw ill post the fla. can’t really post the code cuz don’t have time right now, but let me know

I have done this for you. It has an on rollover scroll, a _root action to make the mc glow, and a mousedown slider.

Hope u like it!

:nerd:

otherwise, i was missing the point heh heh =(

cool scroller

Hey yeah, that IS a great scroller, but it doesn’t really get at the _root of my problem, heh heh. When I test my movie the arrow that I want to follow the mouse doesn’t appear where I first put it. Then when the mouse moves it slides way below the _y position (I’m only working with _y, not _x).

Could it be that other actions on the movie clip that contains the arrow clip could be messing with the positioning? Should I post my file (it’s big cuz there is a lot of other stuff going on on it).

post the file

Okay, here it is. Like I said, it’s full of other stuff, and none of the buttons will actually load anything because I didn’t upload any of the swfs that go with it. But here are the two issues I’m having with this file right now.

www.humboldt.edu/~mgk9/template.fla

  1. Location of the nav menu. When you rollover the “Atlas of California” the menu pops out of the screen. On the mc is the actions to make it move. There are numbers for the “top target” and the “bottom target”. I am wondering if there is anyway to do this using variables instead of straight up numbers. Like a startPosition and a targetPosition or something?

  2. On the menu movie clip is another movie clip for the little arrows. This is the clip that I’m having the easing problem with. When the nav menu slides out and the dynamic menu is loaded I’d like the little arrows to follow the mouse as it rolls over the menu choices. Right now, the arrows don’t start off in the y position that I’ve placed it at on the screen. Also, as you can see they stay well below the _ymouse position also.

Anyone know what gives here? Many many thanks to all who check it out!

Here’s mine with delsaber’s modified code :slight_smile:

http://www.radiofreetokyo.com/popup_2.fla

ok. you could use variables instead of numbers easily. just set them in the (load) and the instead of tx=-25 just use tx=startpostion. i’m not sure why you’ld want to do that though unless you were using that number in multiple places or wanted to change it frequently.

and for the mouse follower try this,

onClipEvent (mouseMove) {
endY = _parent._ymouse;
}

you want to get the value of the _ymouse on the parent clip because
_root._ymouse and slidingNav._ymouse are two diferent numbers unless the registration points are the same.

Genius! The easing thing works like a charm . . . Thanks! And why the heck didn’t I think of that? :trout:

I guess my issue with the nav menu start and ending positions is that by making it absolute like that I’m worried about different monitors etc. and how it’s going to fit. I’m working on a 19" monitor so it’s easy for me to make everything big. Is that something I shouldn’t worry about?

Thanks again for fixing my problem!

Got any tricks in your bag for me kupreg?