actionscript 3 - Assign function argument to global variable of the same name -


is possible set global variable within function takes same variable name argument?

var a:int = 0; function test(a:int) {     *global* = *local*; } test(1); trace(a) // traces 0 i'd trace 1 

(the reason why i'd this, avoid coming different variables names same things) in advance.

you refer explicitly this.a = a; in function test in case this class instance holds variable. in case of static variable, can use classname.a = a.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -