Making a carousel style selector

Hi, i’ve been making a selector where you chose a characters expression/hair etc.

Iv got 2 buttons for each component (left & right) … the code on these buttons tells the movie clip it refers to to move to nextFrame of prevFrame.

When i get to the last frame of that movie clip i want it to go back to the first frame when you press the right button again.

so im thinkin the code should be something like…

for the initial left and right…

right_btn.onRelease = function()
{
blob.nextFrame();
}
left_btn.onRelease = function()
{
blob.prevFrame();
}

and for the end bit im not sure. maybe and if else statement like…

right_btn.onRelease = function(){
if (_root.blob._currentframe =< “5”) {
_root.blob.nextFrame();
} else if (_root.blob._currentframe == “6”) {
_root.blob.gotoAndPlay(1);
}
}

but that doesnt seem to work.

anyone know what im doing wrong???

thanks a lot