1 + 1 = 1 (?)

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 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