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

Dot Syntax

Something else that you will be seeing a lot of as you learn ActionScript is dot syntax. Dot syntax is a way of grouping objects and functions that is used in many object-oriented programming languages.

Here is an example of dot syntax. Suppose that you want to take the square root of a number. Flash has a built-in square root function. It is a part of a group of math functions called the math object. To use the square root function, you first have to use the name of the math object, which is simply Math. The name of the function is sqrt. So this is how you would use the math object's square root function:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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