I believe the example I'm going to provide here is exactly what you asked for, I know it's a late answer but this might help others.
I had the same problem with the pgRouting module in OpenLayers 2.12, in which the starting routing-application code doesn't work with OL 2.12:
var SinglePoint = OpenLayers.Class.create();
SinglePoint.prototype = OpenLayers.Class.inherit(OpenLayers.Handler.Point, {
createFeature: function(evt) { this.control.layer.removeFeatures(this.control.layer.features);
OpenLayers.Handler.Point.prototype.createFeature.apply(this, arguments);
}
});
The changes it needs in order to replace the deprecated component and add functionality with OL 2.12 is as follows:
var SinglePoint = OpenLayers.Class(OpenLayers.Handler.Point);
SinglePoint.prototype = OpenLayers.inherit(SinglePoint, {
createFeature: function(evt) { this.control.layer.removeFeatures(this.control.layer.features);
OpenLayers.Handler.Point.prototype.createFeature.apply(this, arguments);
}
});
It's true that the OpenLayers.Class.create(); is deprecated from OL 2.12 but this is a way to make it work. For more info about deprecated components in OpenLayers 2.12, have a look here: Deprecated components in OL 2.12