• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part I: Foundation > Functions

Chapter 8. Functions

Now that you can write complex statements and affect clip instances by changing their properties, it’s time to learn to modularize your scripts. Placing the same (or very similar) script on several buttons is a cry for help. Every time you copy and paste the same block of code, a little voice should be saying, “No!” In Chapter 3, “The Programmer’s Approach,” we discussed why you want to reduce repeated code. Now you’ll see one great way to do it: functions.

Among all the benefits of functions, the core benefit is that you can store code in one place and access it as much as you want. Type it once, use it a million times. This chapter will introduce other benefits as well as show you how to create functions.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint