Using events to make the box movable