Answer: I suspect the flies were breeding in the mulch where it was previously stored. Now that the mulch has been spread, the eggs are hatching and the flies are disbursing. As long as they can find feeding and breeding ground in your yard, they will hang around. So, allow the top of the mulch to dry out (this will discourage the flies). While you're waiting, the use of a repellent (DEET, permethrin) may be able to provide some short term protection. Products containing DEET may be applied to clothing and skin while permethrin products may be applied to clothing only. Be careful not to overapply these products. When using DEET products on children, use as dilute a solution as possible, usually 10% or less.
Best wishes with your garden!
Q&A Library Searching Tips