# \[AS2\] Prototype methods not found

**URL:** <https://forum.kirupa.com/t/as2-prototype-methods-not-found/294396>\
**Category:** flash\
**Created:** [August 13, 2009, 12:49pm UTC](https://forum.kirupa.com/t/as2-prototype-methods-not-found/294396 "2009-08-13T12:49:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Psaldorn](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@Psaldorn](https://forum.kirupa.com/u/Psaldorn)\
**Post date:** [August 13, 2009, 12:49pm UTC](https://forum.kirupa.com/t/as2-prototype-methods-not-found/294396/1 "2009-08-13T12:49:53Z")

</div>

Hi all,  
I’ve always had a problem getting prototyped methods to show for some base objects, bt not heard of other people having the same issue. Here’s an example:

```auto

Object.prototype.varDump = function():String
{
	var strReturn:String = '';
	for (var i in this) 
	{
		if(i != 'varDump')
		{
			if (this* instanceof Object) 
			{
				strReturn += '////// Start Details of "'+i+'"'+newline;
				strReturn += this*.varDump()+newline;
				strReturn += '////// End Details of "'+i+'"'+newline;
			} 
			else 
			{
				strReturn += i+" : "+this*+newline;
			}
		}
	}
	return strReturn;
};

Color.prototype.setBrightness = function(bright) 
{
	trace("Just for example");
};
ASSetPropFlags(Color.prototype, "setBrightness", 1);

```

Calling Object.varDump(); works fine.

Calling Color.setBrightness(); gives me:

```auto

**Error** Scene=Scene 1, layer=IMPORTS, frame=1:Line 138: There is no method with the name 'setBrightness'.

```

The prototypes are all included in a seperate as file, so it’s not becuase it’s not there - is it just becuase Color is protected?

I’ve been ignoring it and creating normal functions but it’s just got on my nerves now. Probbaly be moving to AS3 soon, so I’ll hav my own classes, but until then - any ideas?

Cheers
