SWiSH Player Support
SWF4 or later - Supported Internally
Syntax
expression1 plus expression2
Arguments
expression: A number or a variable that evaluates to a number.
Returns
Floating-point result of expression1 plus expression2.
Description
If both expressions are integers, the sum is an integer. If either or both expressions are floating-point numbers, the sum is a floating-point number
Sample
This statement below adds the integers 2 and 3 and displays the resulting integer, 5, in the 'Debug' window:
trace (2 plus 3);
This statement below adds the floating-point numbers 2.5 and 3.25 and displays the result, 5.75, a floating-point number, in the 'Debug' window:
trace (2.5 plus 3.25);
This statement will add the sum of both variables as numbers:
onLoad() {
num1 = "10";
num2 = "9.55";
trace(num1 plus num2);
}
// The output in the Debug window will be 19.55
See Also
+ (addition), add (concat strings)