onChanged prototype

How would I convert this code to a prototype? It’s escaping me at the moment.

charCount = new Object();
charCount.onChanged = function() {
	if (message.length == 6) {
		Selection.setFocus("message2");
	}
};
message.addListener(charCount);