# 1 + 1 = 1 (?)

**URL:** <https://forum.kirupa.com/t/1-1-1/295711>\
**Category:** flash\
**Created:** [September 3, 2009, 8:14am UTC](https://forum.kirupa.com/t/1-1-1/295711 "2009-09-03T08:14:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kleelof](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kleelof](https://forum.kirupa.com/u/kleelof)\
**Post date:** [September 3, 2009, 8:14am UTC](https://forum.kirupa.com/t/1-1-1/295711/1 "2009-09-03T08:14:08Z")

</div>

Hello,

I’m having a bit of a problem here. The following code, it seems to me, should print ‘2’. However, it prints a ‘1’.

var a:Number = 1;  
updateVal(a);  
trace(a)

function updateVal(num:Number):void{

num++;

}

Am I missing something? I came from a [VB.NET](http://VB.NET) background, where a call like this would update the value of ‘a’. And, on a related note, if I have a variable in my document class that I stick in a MovieClip, then I update the variable from my document class, the change is not reflected in the copy in the MovieClip. Is there a way to overcome this?

take care,  
lee
