Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button movie on mouseout?

Status
Not open for further replies.

Thoe99

Programmer
May 11, 2001
119
US
How would you go about making a button that plays an MC when you move your mouse off the button? For example, I have a button that scales up when you hover it, so how would I make it scale down when I move off the button?
 
just make the animation the play backwards on rollout..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
The button symbol doesn't have a rollout key, so I'd have to actionscript it in the scene to roll out. But what do I call up when I tell it to do something on rollout?
 
on (rollOver) {
_root.blah.direction = "ff"
}
on (rollOut) {
_root.blah.direction = "rr"
} Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Check this out :

faq250-1292 Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Thing is....I can't add that script to a movieclip, it won't let me do mouse functions on movieclips. And if I make it a button, there's no mouseoff keys.
 
Which version of flash are you using??? Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Coding is on the button? Or the mc?
Using onClipEvent?

Regards,
wink4.gif
ldnewbie
 
If you go back to Dave's earlier suggestion you should be able to get this working.

The trick is not to think of this as purely a button exercise. Here's the breakdown.

What you need is something which looks like a button but is actually a movieClip - create it with three stages: normal display, rollOver, rollOut (i.e. the three different graphics or animations you want to show, they can be any amount of frames in length). Label each section so you have something to target later on.

Add a layer to the movieClip above the animation layer an place an invisible button in this layer directly over the clip. If you haven't made one of these before just place a shape in the "hit" frame but leave the rest blank -it shows as a semi-transparent shape when you place it on the stage but is invisible in the movie. It still can be scripted as a button though...

Now back to where Dave was - adding actions to the button which trigger your movieclip.

on(rollOver){
gotoAndPlay("rollover");
}
on(rollOut){
gotoAndPlay("rollOut");
}

Should do it.
 
Wangbar expalined this really well for me before and I can mail you a basic .fla which displays what he told me if you want.

Just mail me at ski_69@hotmail.com and I will mail it to you

John
 
Awesome! That was it! The invisible button was what I had to have to complete it. That's what allowed me to put some mouse functions on the button, and at the same time have it animate both rolling in and out. Thanks a lot for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top