Playing frames as mouse rolls out

I have a code attatched to button
on(rollOver){gotoAndPlay(2);}

I have Other animation on frame 42.

How to do that, once I mouseOver flash plays frame 2.
Once mouseOut flash plays 42 frame. The code like:

on(rollOver){gotoAndPlay(2);}
on(rollOut){gotoAndPlay(42);}

is wrong I know. How to do that please help. Thank you.