How to give actions to MC Button?

Hello, I would like to know how to give an action to a Movie Clip Button.
Right now the movieclip is an instance named “button_mc”, and I wrote this code in the main timeline.

stop();
this.button_mc.onRollOver = function() {
button_mc.gotoAndPlay("_over");
};
this.button_mc.onRollOut = function() {
button_mc.gotoAndPlay("_out");
};

This script is only for onrollover and rollout events.
It works, but I don’t know what script to add (and where) for the “button” to react to the tipical “on(release)” action.
If someone can help me, would be greaaaat!!

For starters all of that code is redundant since Flash will automatically go to frames labeled _up, _over and _down when the respective event is called. To have a function called when the movie clip is pressed, use this code:

button_mc.onPress = function():Void  {
 trace("onPress");
};

Hope this helps :mountie:

you can give like this

button_mc.onRelease=function()
{
_root.button_mc.gotoAndPlay("_over");
};

i hope this helps u

Yep. I had this problem a few days ago and using “_root” worked.