Assignment Operators in ActionScript
Notes:
Assignment Operators in ActionScript Programming Language:
Assignment Operator: is used to assign a value to variable or a constant.
= : Assignment Operator
Short Hand Assignment (SHA): AA (Arithmetic Assignment)
+=
-=
*=
/=
%=
Example code:
const PI:Number = 3.142;
trace("PI=",PI); // PI=3.142
var a:int = 10;
trace("a=",a); // a=10
a = 20;
trace("a=",a); // a=20
a += 10; // a = a + 10;
trace("a=",a); // a=30
a-=10; // a = a - 10;
trace("a=",a); // a=20
a*=2; // a = a * 2;
trace("a=",a); // a=40
a/=2; // a = a / 2;
trace("a=",a); // a=20
a%=2; // a = a % 2;
trace("a=",a); // a=0
a += 10;
trace("a=",a); // a=10