O'Reilly logo

Fundamentals of ActionScript 3.0: Develop and Design by Doug Winnie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3. Working with Functions

When you work with ActionScript, there are sequences of code that you may want to execute multiple times. To do this, you need a way to group the code into a logical block and give it a name that will tell the Flash runtime to execute the code.

Functions are the way to do exactly that. Using functions, you can group commonly used commands for repetitive use throughout your application. In this chapter, you’ll learn the commands and syntax to create a basic function, and then learn how you can extend the use of your functions to send and receive data in and out of them.

Fundamentals of Functions

To get started with functions, let’s look at the following example.

1. Create a new ActionScript 3.0 Flash file and enter the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required