Building an Address Book > Creating the Application Functions

 

Creating the Application Functions

Most of the code in the address book application is packaged into functions (stored on frame 1 of the scripts layer). The functions are all the tasks our application can perform. These tasks fall into four categories, show below:

Setup
init()

Screen Display
populateListBox()
populateDetailsPane()
sortListBox()
setGlobalStyles()
handleFieldFocus()
handleFieldBlur()

Application State Switching
enterEditMode()
exitEditMode()
cancelEditMode()

Data Management
doAddContact()
doUpdateContact()
doRemoveContact()

For the remainder of this tutorial, we'll study each function individually, examining how they work line by line.