During melting or boiling the temperature stops rising because extra energy is needed, which is taken from the heat source, to overcome the strong forces of attraction which are holding the molecules together. This energy will not increase the speed of the molecules it will only break the bonds