Hey all!=)
I am having some problems with my button. I want it to do this:
on rollover hover up
on rollout hover down
Could somebody please show me how to do that?
Thank you!:trout:
ps. here is the file also.
regards: Diasy
Hey all!=)
I am having some problems with my button. I want it to do this:
on rollover hover up
on rollout hover down
Could somebody please show me how to do that?
Thank you!:trout:
ps. here is the file also.
regards: Diasy
You can use hitTest on it, I had to change your setup a bit, but nothing too major. Here is the file, enjoy. =)
Could you explain me please what you did and how?:sure:
I would have done it like this, but then I’m no xepert like these guys!
hope it helps…
FW
What I did was create a new MC called ButtonMC that contains a tween of the button moviing up.
I deleted what you had before on the main timeline and replaced it with that ButtonMC.
On ButtonMC, I placed the hitTest script:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
What that does is when you have the cursor over the button or when the cursor hits the button, it tells that ButtonMC to play the nextFrame as long as the cursor remains on ButtonMC.
If the cursor leaves or moves off of ButtonMC, it tells ButtonMC to play the previous frame. So as long as the cursor is off the button, it will keep on playing the previous frames of the tween going down.
I hope that is a bit clearer, sorry if it sounds confusing. =)
FIREWIGHT, your way is a lot simpler, but the only problem is that if you play around with it, you’ll see that it jumps to the top sometimes and isn’t really smooth. That’s also another way to do it as well though, thanks for posting it. =)
Aah okey. Thank you both for your great examples, there seems to be more then one way to make this effect lol, my hea is going round and round with so many options:P
Thank yoU!:beam:
You’re welcome. =)
HEHEhehe yeah i know, I’m still new to all this action scripting stuff, so I went with the simpler button/mc style…
The reason for the jumping is if the rollover mc has not finished when you move the mouse away, it jumps to the start of the original mc, which starts at a higher position…
shrug
I like your way, except you need to follow the mc with the mouse to get it all the way to the top…
Ahh well, more than one way to skin cat! (that’s a saying over here, dosn’t actually mean ‘skin a cat’ )
FW
hahah yeah there’s definitely more than one way to do things. =)
:: Copyright KIRUPA 2024 //--