use the macro setting (typically a picture of a flower), use good lighting, and a solid background (blue or gray works well)
focus on the fly from about a foot or so away, and click the button half way down. Once it focuses on the fly, then push the camera closer to the fly and it should keep the focus.
Just a little trick that has worked for me.