i had the same problem a few weeks ago. try to catch one in something like a shot glass, they're extremely easy to catch. get some fingernail polish remover(has to contain acetone) on a cotton ball and put it in the shot glass with the fly turned down on a table or something for a few minutes, this will kill the fly without smashing it and will give you a chance to examine the fly and compare it with pictures on the net, I linked my flies to what is known as "sciarids" or fungus flies. I also used the polish remover cotton swabs around my plants, not touching them, to drive them away until I could find the right chemicals to treat the larvae in the soil without hurting my plants. oh and that "moving soil" is very very bad, majority of these flies thrive on your plants roots, and they can cause a lot of damage very fast.