I am trying to learn how to do this marker at http://www.newezra.com/
how do you make snap back when you rollOut, and also change the width to the size of the btn??
Thanks!!!
I am trying to learn how to do this marker at http://www.newezra.com/
how do you make snap back when you rollOut, and also change the width to the size of the btn??
Thanks!!!
Here’s my best guess:
shouldn’t be too hard!
:hr:
Yeah but how do you make snap back to where is started??
thanks lunatic :thumb:
Well you probably already know to store the initial coordinates. Then I would start researching ‘bounce’ or ‘elasticity’.
Here is a kirupa tutorial you can look into :
elasticity
and here is something else I found: bounce
Hope these help.
:hr:
Thanks :thumb:
Ok lunatic,
Check this out. I have it working but the rollOver is not really working that good it only works if you rollOut of the marker you have any ideas? Maybe a hitTest?
I only have MX - could you resave as MX version?
:hr:
Kay try that one;) ^^
Okay, I think I figured it out - though I totally screwed up your x coordinates, sorry!
The problem was that your navslider was in the same movie clip as the buttons. Don’t know if you already knew this but whenever you use ‘this’ as in ‘this.onEnterFrame’ you are refering to the timeline of the movieclip you are in. So when you were using this code:
this.hitTest(_level0._xmouse, _level0._ymouse, 1))
you were telling Flash to check for a hitTest between the mouse and the navslider, because you were using ‘this’ on the timeline of the navslider. That’s why it only worked when your mouse was on or off the slider.
I’m not totally sure why the rollOut was only called when the mouse moved down, and not up, but anyway - I took the navslider out of the nav movie clip and place it on the main timeline. Then I just changed the code a bit to reflect the correct pathways to the movie clips and voila!
So you’ll have to go in and change your numbers around to reflect the locations but otherwise good to go.
You might want to try to figure out how to have the navslider move to the _x location of each button, and scale the navslider’s width to the width of each button instead of hard coding the numbers. That way it won’t matter in the future where you move them.
:hr:
:: Copyright KIRUPA 2024 //--