The rope that triggers the trap is attached to an eye-let next to the door, then to the bottom of the door itself, so it can only be detected after the door has started to open. Opening the door all the way, or entering the room, triggers the trap.