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

Chapter 7. Classes > Understanding classes and scope

Understanding classes and scope

When you move ActionScript code into classes, you might have to change how you use the this keyword. For example, if you have a class method that uses a callback function (such as the LoadVars class’s onLoad() method), it can be difficult to know whether the this keyword refers to the class or to the LoadVars object. In this situation, it might be necessary to create a pointer to the current class, as the next example shows.

To understand scope and external class files:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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