Funny "if statement"

hii all…

I building a photoviewer with xml loaded pics…

my problem right now is that i should building the back button, but i dont know how …

it should be:

when i press back-button(mc) (its placed on frame 10 to frame 20)
it should gotoandplay frame 21
and when its hits frame 30
it should read, if back-button was clicked it should play frame 50, if not it should play frame 31.

hope anyone understod my problem and can help me… please…

thx