Best thing for you to do is runaway and runaway fast as some numbnuts strolling around a shooting area with a weapon is liable to get himself shot by the professionals responding to the situation or by another numbnuts trying to be a hero.
The last thing I'd do is try to take on an active-shooter (especially one armed with a rifle) with a handgun and only engage in gunplay as a last resort."
Depends on the situation bro. Running away would get you killed in the theater massacre, and the one in the school there was really no where to run. That is not always an option . If you do run away you have to be conscious enough to run away in zig zags or you could easily be shoot. Engaging an active shooter is not what happens usually the active shooter engages you or people nearby. If you can take the shoot safely you should. For example, say you could flank the shooter or at least keep his head down, and cause him to panic you could save lives.