Code Problem....fast help appreciated

i got this code:

[AS]effect.onEnterFrame = function() {
(success) ? effect.nextFrame() : effect.prevFrame();
};
button.onRollOver = function() {
success = true;
};
button.onRollOut = function() {
success = false;
};
button.onRelease = function() {
success = false;
};[/AS]

on a frame, for use on a button (obviously),
i want to make it so on release i have a gotoandplay function for frame 390, AS WELL as the success false action.

is there any way i can get this action into the above code? I tried several different ways, all come up with Error when its debugged.

Fast replies MUCH appreciated