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

Explicit Scoping

Scoping is telling the ActionScript interpreter where to look for a variable, movie clip, object, or array. The interpreter can look in a function, in an object, in a timeline, in the Object object, or in _global. You can tell it specifically where to look, and then it looks just in that one place. That is explicit scoping, the subject of this section. Or you may deliberately not tell the interpreter where to look, and then it follows its own automatic scoping rules. That type of scoping is covered next in the “Automatic Scoping” section.

Scope is like a sophisticated filing system. You can use it both to find things and to keep things private. Unfortunately, misfiling is also possible: Subtle bugs can result when the ActionScript interpreter is unable to find something or finds the wrong thing.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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