If the flying maneuverability is Average of worse, the creature must keep a minimum flying speed or fall to the ground. That entails a move action, leaving a standard action to be taken for spellcasting. If your spell is a full-round casting time, you need to take the Begin/End Full-Round Action option, taking 2 rounds to finish it.