# Can someone help me with my prototype?

**URL:** <https://forum.kirupa.com/t/can-someone-help-me-with-my-prototype/55056>\
**Category:** flash\
**Created:** [June 20, 2004, 3:56pm UTC](https://forum.kirupa.com/t/can-someone-help-me-with-my-prototype/55056 "2004-06-20T15:56:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfriction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindfriction/32/172_2.png) [@mindfriction](https://forum.kirupa.com/u/mindfriction)\
**Post date:** [June 20, 2004, 3:56pm UTC](https://forum.kirupa.com/t/can-someone-help-me-with-my-prototype/55056/1 "2004-06-20T15:56:51Z")

</div>

Hi,

I created a prototyped to format my flash form elements, namely the TextFields. It almost works, except I can’t get the  
onSetFocus and onKillFocus functions working…It has something to with the fact my prototype is a MovieClip and these are TextField functions, but I cant figure out for the life of me how to make it work.

Thanks in advance 🙂

```auto

// ActionScript Document
_global.FormatForm = function(form){
	this.form = form;
	this.init();
};
FormatForm.prototype = new MovieClip();

FormatForm.prototype.init = function(){
	// --------------------
	// TextField Styles
	// --------------------
	this.normal_border = 0xCCCCCC;
	this.select_border = 0x000000;
	this.normal_background = 0xEEEEEE;
	this.select_background = 0x0066FF;
	this.normal_color = 0x999999;
	this.select_color = 0x666666;
	
	this.format();
};

FormatForm.prototype.format = function(){
	for(var a in this.form)
    {
        this.form[a].border = true
        this.form[a].borderColor = this.normal_border
        this.form[a].background = true
        this.form[a].backgroundColor =this.normal_background
        this.form[a].textColor = this.normal_color
		this.form[a].onSetFocus = this.selected();
		this.form[a].onKillFocus = this.deselected();
    }
};

FormatForm.prototype.selected = function()
{
    this.borderColor = this.select_border
    this.backgroundColor = this.select_background
    this.textColor = this.select_color
}
FormatForm.prototype.deselected = function()
{
    this.borderColor = this.normal_border
    this.backgroundColor = this.normal_background
    this.textColor = this.normal_color
}

```
