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

Assigning methods to a custom object in ActionScript 1.0

Assigning methods to a custom object in ActionScript 1.0

Note

Many Flash users can greatly benefit from using ActionScript 2.0, especially with complex applications. For information on using ActionScript 2.0, see Chapter 7, “Classes,” on page 231.


You can define the methods of an object inside the object’s constructor function. However, this technique is not recommended because it defines the method every time you use the constructor function. The following example creates the methods getArea() and getDiameter(): and traces the area and diameter of the constructed instance myCircle with a radius set to 55:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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