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

Chapter 11. Manipulating Information > Building Custom Classes with Functions

Building Custom Classes with Functions

You can use functions not only to combine multiple actions in a single task or a single event handler, but also to define the properties and methods of new classes, so you can organize and customize information in your scripts for easier access and storage and to create functionality that Flash doesn’t provide. After you create a custom class, use a constructor function to instantiate an object of your class. Consider this simple function:

function Circle (whatRadius){
 this.radius = whatRadius; 
} 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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