This paper investigates a distributed formation control problem for networked robots, with the global objective of achieving predefined time-varying formations in an environment with obstacles. A novel fixed-time behavioral approach is proposed to tackle the problem, where a global formation task is divided into two local prioritized subtasks, and each of them leads to a desired velocity that can achieve the individual task in a fixed time. Then, two desired velocities are combined via the framework of the null-space-based behavioral projection, leading to a desired merged velocity that guarantees the fixed-time convergence of task errors. Finally, the effectiveness of the proposed control method is demonstrated by simulation results.