[AS2] Prototype methods not found

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:


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:


**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