Button loses it's rollover functions

I have a movieclip that has a button symbol in it.

When it is a movieclip and I put this AS on it:
on (press,release) {
_root.all_stage.gotoAndStop(23);
_root.all_stage.lb2_stage.gotoAndPlay(2);
}

It works fine, but loses the button rollover qualities.

I tried turning the above into a button to remedy it , but then the rollover works BUT the AS doesn’t.

Please help, been pulling my hair out.

Thanks in advance.

make it a movie clip and give it this AS
onClipEvent(load) {
this.onPress = this.onRelease = function(){
_root.all_stage.gotoAndStop(23);
_root.all_stage.lb2_stage.gotoAndPlay(2);
}
}
if you want the press and release events to do something different from each other do this
onClipEvent(load) {
this.onPress = function(){
_root.all_stage.gotoAndStop(23);
_root.all_stage.lb2_stage.gotoAndPlay(2);
}
this.onRelease = function(){
//do some other stuff on release
}

}

Thank you paradox, but unfortunatley it still loses the rollover functions. Is there a way to keep it a button and not an mc and add the same above functions?

Thanks again.

I think I misread what you were saying…
This is what you have:
mcWithAButtonInIt
–buttonInTheMc

heres what the code should look like if the mc and button had those instance names
on mcWithAButtonInIt put this:
onClipEvent(load) {
this.buttonInTheMc.onPress = this.buttonInTheMc.onRelease = function(){
_root.all_stage.gotoAndStop(23);
_root.all_stage.lb2_stage.gotoAndPlay(2);
}
}
if you want the press and release events to do something different from each other do this
onClipEvent(load) {
this.buttonInTheMc.onPress = function(){
_root.all_stage.gotoAndStop(23);
_root.all_stage.lb2_stage.gotoAndPlay(2);
}
this.buttonInTheMc.onRelease = function(){
//do some other stuff on release
}
}

That should do it, however, if it doesn’t, uploading your fla or emailing it to me at shawn[at]veuphoria[dot]com would probably be the fastest way to solve the problem

Good Luck,
Shawn

i think what you need is a hitTest. Fla?

The problem is that you cannot have nested on() events.
As dru_nasty suggested, hittest might be the option.

Thanks guys. I was in such a crunch and then was away this weekend, so I just made a simple fix by turning the button into a movie clip and just advanced frames when it was roll-over-ed.
I’ll just have to figure it out at a later point.

Thanks again!