Adobe Flash Platform Flashcards
are blocks of code that carry out specific tasks and can be reused in your program.
Functions
A function is called a _ if you define it as part of a class definition or attach it to an instance of an object. A function is called a _ if it is defined in any other way.
method, function closure
You call a function by using its identifier followed by the parentheses operator (()).
calling function
You use the _ to enclose any function parameters you want to send to the function.
parentheses operator
use the Math.random() method, which takes no parameters, to generate a random number:
var randomNum:Number = Math.random();
Define your functions with _ if you prefer static, or strict mode, programming.
function statements
Define your functions with _ if you have a specific need to do so; are more often used in dynamic, or standard mode, programming.
function expressions
A function statement begins with the _, followed by:
The function name
function keyword
The _, in a comma-delimited list enclosed in parentheses
parameters
The _—that is, the ActionScript code to be executed when the function is called, enclosed in curly brackets
function body
the following code creates a function that defines a parameter and then calls the function using the string “ hello” as the parameter value:
function traceParameter(aParam:String) { trace(aParam); } traceParameter("hello"); // hello
The second way to declare a function is to use an assignment statement with a function expression, which is also sometimes called a _ or an _. This is a more verbose method that is widely used in earlier versions of ActionScript.
function literal, anonymous function
An _ with a function expression begins with the var keyword
assignment statement
Mouse events such as a button click, double-click, or simply moving the mouse are handled by the _.
MouseEvent class
Since the _ is one of the primary means through which a user interacts with a Flash movie, it’s important to understand how to listen and respond to mouse events.
mouse
The simplest event is the _, which happens when the user presses and then releases the mouse button.
button click,