You have a lot of problems there.
That specific error is because you are tyring to assign the string "6" to a function called prevFrame(). What you want inside of if statements is the comparison operator == not the asignment operator =.
BUT that won't fix your problem either. prevFrame() isn't what you think it is. It is a method (function) of the MovieClip class that tells the playhead to goto the previous frame. If your movie is playing normally, then all you need to know is
If your movie is playing in some kind of random order then you will need to make a way of keeping track of which frames and then use that technique to know. There is no built in way of knowing which frame was played before the current frame.
Or, when you get to frame six you could tell flash to wait one more frame and then do something.
Whatever it is that you are actually trying to do, there is probably a different and easier way to do it.