# Referencing functions

**URL:** <https://forum.kirupa.com/t/referencing-functions/235882>\
**Category:** Uncategorized\
**Created:** [August 15, 2007, 3:26pm UTC](https://forum.kirupa.com/t/referencing-functions/235882 "2007-08-15T15:26:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aquilonian](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Aquilonian](https://forum.kirupa.com/u/Aquilonian)\
**Post date:** [August 15, 2007, 3:26pm UTC](https://forum.kirupa.com/t/referencing-functions/235882/1 "2007-08-15T15:26:10Z")

</div>

I was wondering if its possible to pass a reference for a function, not for what that function returns and put that reference to another function, i mean, something like that:

```php

function f1(av:int){
 trace(av);
}
var ob1:Object = new Object();
//ob1.f2 = function(){}
ob1.f2 = f1;
ob1.f2(3);//3 ok
function f3(){};
f3 = f1;
f3(2);//not ok

```

I mean, it works when the second function is inside an object, so how this can work when the second is not inside anything?
