You call a function by using its identifier followed by the parentheses operator (()). You use the parentheses operator to enclose any function parameters you want to send to the function.
For example, the trace() function, which is in the flash.util package of the Flash Player API, is used throughout this book:
For example, the trace() function, which is in the flash.util package of the Flash Player API, is used throughout this book:
trace(“Use trace to help debug your script”);If you are calling a function with no parameters, you must use an empty pair of parentheses. For example, you can use the Math.random() method, which takes no parameters, to generate a random number:
var randomNum:Number = Math.random();