Commands, Functions and Operations

I l @ ve RuBoard

So far, I have used the term keywords to describe elements of ActionScript. For instance, gotoAndPlay is a keyword. It is also a command.

graphics/newterm.gif

A command is an element of ActionScript that tells Flash to do something specific. Commands are obeyed as long as they make sense. For instance, if you use gotoAndPlay with a frame label that doesn't exist, the command cannot be executed.

Commands are the most basic element of programming. In Flash, little can be done without using at least one command. We'll be learning many commands throughout the rest of the book.

graphics/newterm.gif

Functions are terms in ActionScript that perform a calculation and return a result. For instance, a function might take a single number and return the square root of that number.

graphics/newterm.gif

Both commands and functions can take one or more parameters. A parameter is a value passed to the command or function. The gotoAndPlay command needs at least one parameter to work: the name or number of the frame to go to. A square root function would need a single number value as a parameter.

graphics/newterm.gif

Different than commands and functions are operators. These are usually symbols, not words. For instance, the + operator performs addition between two values.

You'll be using commands, functions, and operators throughout your ActionScript programming.

I l @ ve RuBoard


Sams Teach Yourself Flash MX ActionScript in 24 Hours
Sams Teach Yourself Flash MX ActionScript in 24 Hours
ISBN: 0672323850
EAN: 2147483647
Year: 2002
Pages: 272

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net