As mentioned, you will have to turn off the auto focus. The best way to do it is to prepare everything, and with the regular lights on, set the focus. Then you can turn the lights off leaving the blacklights on, and take your picture. With the focus locked in manual mode, it will not change, only the exposure settings will change. If it were me, I would also set the aperture manually to as small as possible to assist in retaining focus, but the exposure will be very long. You may have to adjust the exposure manually. For the best pictures of flies, remember to turn the macro mode on as well. I quickly checked the specs on your camera, in standard macro mode, the object still needs to be at least 30cm from the lens (about a foot). There is the option of using super macro mode where the object can be as close as 3cm (just over an inch) but in my experience, it is best to stay within normal ranges. Keep the flies just over a foot from the camera and use macro mode. If need be, you should still be able to use the zoom in macro mode to get a closer picture.