Robotic applications are expanding into dynamic, unstructured, and populated environments. Mechanisms specifically designed to address the challenges arising in these environments, such as humanoid robots, exhibit high kinematic complexity. This creates the need for new algorithmic approaches to motion generation, capable of performing task execution and real-time obstacle avoidance in high-dimensional configuration spaces. The elastic strip framework presented in this paper enables the execution of a previously planned motion in a dynamic environment for robots with many degrees of freedom. To modify a motion in reaction to changes in the environment, real-time obstacle avoidance is combined with desired posture behavior. The modification of a motion can be performed in a task-consistent manner, leaving task execution unaffected by obstacle avoidance and posture behavior. The elastic strip framework also encompasses methods to suspend task behavior when its execution becomes inconsistent with other constraints imposed on the motion. Task execution is resumed automatically, once those constraints have been removed. Experiments demonstrating these capabilities on a nine degree-of-freedom mobile manipulator and a 34 degree-of-freedom humanoid robot are presented, proving the elastic strip framework to be a powerful and versatile task-oriented approach to real-time motion generation and motion execution for robots with a large number of degrees of freedom in dynamic environments.