ADBRITE ads links
You are here: CodeIdol.com > Flash > Macromedia Flash® ActionScript: Training from the Source > Lesson2.Functions
Macromedia Flash® ActionScript: Training from the Source
| Lesson 2. Functions
When programming, you might find yourself using the same chunks of code repeatedly either by copying and pasting them or by rewriting the same lines of ActionScript. There is a way to write ActionScript just once and reuse it a...
|
|
| What You Will Learn
In this lesson, you will:
Create a functionCall a functionAdd parameters to a functionCreate a function that returns a resultUse local variables
...
|
|
| Approximate Time
This lesson takes approximately one and one half hours to complete.
...
|
|
| Lesson Files
Media Files:
None
Starting Files:
Lesson02/Start/television1.fla
Completed Projects:
Lesson02/Completed/television4.fla
...
|
|
| Creating Functions
Before you use a function, you must create or define it. You can do this by using one of two possible syntaxes.
Syntax 1
This code describes the first syntax:
function myFunction (parameter1:DataType,parameter2:DataType,e...
|
|
| Adding Parameters to Functions
In the preceding exercise, you learned how to create a function and call it. In this exercise, you'll add parameters to a function and learn how to use them. Here's the syntax for creating a function that accepts par...
|
|
| Using Local Variables and Creating Functions that Return Results
The variables you've created and used so far can be accessed at any time by any script in the Flash movie. In contrast, local variables are special variables you can create and use o...
|
|
| What You Have Learned
In this lesson, you have:
Created functions using various syntaxes (pages 3943)Passed arguments into functions while calling them (pages 4353)Used local variables (pages 5354)Returned and used the results of calling a functi...
|
|
You are here: CodeIdol.com > Flash > Macromedia Flash® ActionScript: Training from the Source > Lesson2.Functions
|
|
Related tags
Popular Categories
Unix books and guides
AJAX popular information
C# language guides
Windows books and cookbooks
.......
|
|