# onChanged prototype

**URL:** <https://forum.kirupa.com/t/onchanged-prototype/99021>\
**Category:** Uncategorized\
**Created:** [January 13, 2004, 9:33pm UTC](https://forum.kirupa.com/t/onchanged-prototype/99021 "2004-01-13T21:33:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![binkyboo](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@binkyboo](https://forum.kirupa.com/u/binkyboo)\
**Post date:** [January 13, 2004, 9:33pm UTC](https://forum.kirupa.com/t/onchanged-prototype/99021/1 "2004-01-13T21:33:28Z")

</div>

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

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

```
