Asking for help usually works.
Honestly, I usually stay focused and try to get out as soon as possible. But sometimes staring at a nice booty while you're running or finishing a tough set is helpful.
I've never had any luck flirting in the gym. It may be because I'm older or I've got no game. So 99% of the time I work out, talk to friends and split.