# onChanged onKillFocus problem

**URL:** <https://forum.kirupa.com/t/onchanged-onkillfocus-problem/1792>\
**Category:** flash\
**Created:** [May 22, 2002, 4:00pm UTC](https://forum.kirupa.com/t/onchanged-onkillfocus-problem/1792 "2002-05-22T16:00:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 22, 2002, 4:00pm UTC](https://forum.kirupa.com/t/onchanged-onkillfocus-problem/1792/1 "2002-05-22T16:00:34Z")

</div>

can anyone provide a concrete ex. of onKillFocus or onChanged calling an outside funtion? I’ve been totally unable to do this following the examples included with MX

Thanks All!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 23, 2002, 6:17pm UTC](https://forum.kirupa.com/t/onchanged-onkillfocus-problem/1792/2 "2002-05-23T18:17:32Z")

</div>

myText.onSetFocus = function () {  
myText.backgroundColor = yellow; //need to assign a hex coded color to the var ‘yellow’ before!  
};

myText.onKillFocus = function (){  
input = Number (input); //input txt is treated as string by default!  
if input \< 10{  
myText.backgroundColor = black; //or do whatever  
}else{  
myText.backgroundColor = green; //likewise…  
}

notes: you need to set myText.backgroundColor = true; before you use this;  
define colors like yellow = 0xFFFF00;

Helps?
