Title here
Summary here
Const Declarations:
const s:String = "constant";
declares a constant string.trace(s);
outputs the value of s
.Numeric Constants:
const n:Number = 500000000;
declares a numeric constant n
.Constant Expressions:
const d:Number = 3e20 / n;
demonstrates a constant expression performing arithmetic with arbitrary precision.trace(d);
outputs d
.trace(int(d));
converts d
to an integer and outputs it.Type Conversion:
trace(Math.sin(n));
passes n
to Math.sin
, which expects a Number
.To run the program, compile and execute it using Adobe Flash Player or an appropriate compiler for ActionScript.
Next example: For.