The previous section describes the differences between as 3.0 references and value types. References are often used in programming and are useful, at least what are the advantages? You can think about it yourself. I will not mention it. Now, let's compare the difference between reference and value type.
Value type:
Is to directly access the variable address
Reference:
Is to reference the address of a variable, the value will change because of a variable change
Here is an example.
Var an: int = 3;
Var bn: int =;
Bn = 65555;
Trace (The 'an value is '+ );
Trace (The 'an value is '+ bn );
The output value is:
An = 3; bn = 65555;
This is a feature of the value type. Let's look at the reference below.
Var td: array = new array (1, 2 );
Var bd: array = td;
Bd [0] = 120;
Trace (The 'an value is '+ td );
Trace (The 'an value is '+ bd );
The output values of td and bd are:, 2, 1
Well, if you can understand it, you have to take a look. Finally, I would like to make a statement. Please respect my work. Please refer to www.111cn.net/flash_a/flash.html.