Function inherits from Object so you should be able to do...

Object(this.test).prop = "someprop";

Why are you doing this?  What are you trying to do... it sounds interesting.

On 12/6/06, Derek Vadneau <[EMAIL PROTECTED]> wrote:

  I've tried using the example from the docs where you assign the value
to a property on the function and then use arguments.callee.prop to
get the value, but Flex Builder gives me an error saying "Access of
possibly undefined property prop through a reference with static type
Function." when assigning the value to the function.

Example:
function test()
{
trace(arguments.callee.prop);
}
test.prop = "testing"; // Error

Global.as defines Function as dynamic yet FB produces an error.

This is supposedly possible in AS3 as per:
http://livedocs.macromedia.com/flex/2/docs/00001835.html

However, if you try the last example you'll get compiler errors.

Is there a way to add properties to a function? Or is this not supported
in AS3?

--

Derek Vadneau

Reply via email to