In this paper, a general framework for trajectory planning for specified tasks in a dynamic environment is discussed. Since we are interested in dynamic tasks and environments, a `planner within the feedback controller' approach is adopted. Trajectory generation for a particular dynamic behavior is shown to lead to several constraints in the state or control space. We use the concept of forward projection and preimages to generate these constraints. The trajectory is then planned using a dynamic constraint-generation and constraint-satisfaction framework. The lowest level motor controller behavior is altered by constraints generated by the constraint generation level on top. The solution to the resulting constrained problem, which is accomplished in real-time, automatically generates a desired dynamic behavior.