# Passing object as parameter

**URL:** <https://forum.kirupa.com/t/passing-object-as-parameter/303272>\
**Category:** Uncategorized\
**Created:** [January 18, 2010, 4:30am UTC](https://forum.kirupa.com/t/passing-object-as-parameter/303272 "2010-01-18T04:30:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emrsag](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@emrsag](https://forum.kirupa.com/u/emrsag)\
**Post date:** [January 18, 2010, 4:30am UTC](https://forum.kirupa.com/t/passing-object-as-parameter/303272/1 "2010-01-18T04:30:29Z")

</div>

[SIZE=1]_Sorry for duplicating the tread._[/SIZE]

Hi all,

I have a function that goes like this;

```auto
function goback1(event:Event) {
    cont.nums.y=86.5;
    var gnerden=cont.nums._1Ocak.height;
    var gynerden=cont.nums._1Ocak.y;
    var gynereye=cont.nums._1Ocak.y+15;
    var gbnerden=cont.nums.myback1.y;
    var gbnereye=cont.nums.myback1.y+15;
    var load1tw:Tween=new Tween(cont.nums._1Ocak,"height",Regular.easeOut,gnerden,30,1,true);
    var load2tw:Tween=new Tween(cont.nums._1Ocak,"y",Regular.easeOut,gynerden,gynereye,1,true);
    var bgtw:Tween=new Tween(cont.nums.myback1,"height",Regular.easeOut,cont.nums.myback1.height,0,1,true);
    var bgtw2:Tween=new Tween(cont.nums.myback1,"y",Regular.easeOut,gbnerden,gbnereye,1,true);
}

```

my problem is, i have more than 20 buttons, and i have 20 copies of this same code for all those buttons.  
according to my limited knowladge with c++, i should pass the object as the parameter and use the same code for 20 buttons.

how can i do that?  
i tried function goback1(object:event.Object) or (object:event.this) but they didn’t work.
