# Quick fix: Passing a int Variable into a function

**URL:** <https://forum.kirupa.com/t/quick-fix-passing-a-int-variable-into-a-function/269697>\
**Category:** flash\
**Created:** [August 31, 2008, 12:39am UTC](https://forum.kirupa.com/t/quick-fix-passing-a-int-variable-into-a-function/269697 "2008-08-31T00:39:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z11](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@Z11](https://forum.kirupa.com/u/Z11)\
**Post date:** [August 31, 2008, 12:39am UTC](https://forum.kirupa.com/t/quick-fix-passing-a-int-variable-into-a-function/269697/1 "2008-08-31T00:39:50Z")

</div>

I can’t seem to get this to work:

var i:int = 0;

function count(a:int):void  
{  
a++;  
}

count(i);  
count(i);  
count(i);

trace(i);//traces 0

Is there a way I can make it do it’s math, to the variable itself, without some crazy solution or using objects to hold the variables?
