If they are fruit flies then put some apple cider vinegar in a cup, tape a piece of saran wrap in it and poke a bunch of holes in it with a tooth pick.
Also do a large cage cleaning while deodorizing everything, they are attracted to rotting fruits and veggies. I get them if I leave hermit crab...