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

Chapter 9. Functions > Nested Functions

9.10. Nested Functions

In ActionScript, functions can be declared within functions. Example 9-10 creates a function, showFullName( ), with two nested functions, showFirstName( ) and showLastName( ).

Example 9-10. A function with two nested functions

function showFullName ( ) {
  function showFirstName ( ) {
    trace("Colin");
  }
  function showLastName ( ) {
    trace("Moock");
  }
   
  showFirstName( );
  showLastName( );
}
   
showFullName( );


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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