O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Function Scope

Code placed in a function body resides in that function's scope. The specific list of definitions available to code in a function's scope depends on the location of that function in the program.

Code in a function defined at the package-level or outside any package can access the following definitions:

  • All definitions available to code in the global scope

  • All local variables, nested functions, and namespaces defined within the function

Code in a function defined within a static method can access these definitions:

  • All definitions available to code in the global scope

  • All definitions available to code in the scope of the static method

  • All local variables, nested functions, and namespaces defined within the function

Code in a function defined within an instance method can access the following definitions:

  • All definitions available to code in the global scope

  • All definitions available to code in the scope of the instance method

  • All local variables, nested functions, and namespaces defined within the function

Code in a function defined within another function can access these definitions:

  • All definitions available to code in the global scope

  • All definitions available to code in the enclosing function

  • All local variables, nested functions, and namespaces defined within the function

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required