Trouble getting a movie clip to stop on a certain frame

Hey all…I have this EMERGENCY right now! I need to get this specific movie clip (controlled by a button) to stop at certain frames based on the day.

So what I’d like is for when someone presses the button, it instructs a movie clip to play - all this is based on what day of the month it is…in this example, it’s today. The date part of this script works fine. If I just write "if (candleDay ==‘17’) {
_root.candles.gotoAndStop(23);
}
the script works fine…but I’d like the in between stuff. I have the movie clip stopped on frame 1 and I want it to play from frame 2 and stop at frame 23 if it’s the 17th…in fact I’ll have more if statements to go along with all this, but that’s just cut and paste…

So, I would like my movie clip, if it reaches a certain frame to STOP. In other words, if it’s the 17th, play this movie clip BUT if the movie clip hits frame 23, stop the movie clip…why isn’t this working? Can anyone offer some advice?

Here’s the script that needs debugging:

on (release) {
candleDate = new Date();
candleDay = candleDate.getDate();
if (candleDay == ‘17’) {
_root.candles.gotoAndPlay(2);
if (_root.candles._currentframe==‘23’) {
_root.candles.stop();
}
}
}

Thanks!