The following doesn’t work since the anAlpha is passed by value, not
by reference, as it is a value. You’ll need to figure out a different
way to either passs as reference(objects are by reference, but
numbers are by value). there are a few ways to accomplish this. The
quickest/dirtiest way would be to use globals. You could also
accomplish by creative use of an object instance, or function
properties (you might want to do some web searches on functions and
lexical closures for some examples of this last approach).
In your example, however, it looks like alpha is a global anyway so
you could just pass in the alpha array index.