Can someone help me with my prototype?

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 :slight_smile:


// 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
}