A noob question

where does the “if” command work? it works in onEnterFrame and press/release, but what about other events?