Building an Address Book > Possible Extensions

 

Possible Extensions

With any application, there's always room for more features. As you explore the address book, try to think of what you could add or change. To get you started, we'll look at a few ideas here.

Server Storage
Use the XML or LoadVars classes to store information on a server, allowing users to be able to access their address book data from any web browser.

Street Address
Try adding a field to store each contact's street address. This is a simple extension that will help you get comfortable with the address book code.

Prettier ComboBox
When the phoneComboBox_cb is disabled, it still looks like a ComboBox. To improve its disabled appearance, use a custom FStyleFormat object to set all the colors in the component to blue. First, create the FStyleFormat object in the init() function, as follows:

  disabledComboStyle = new FStyleFormat();
  disabledComboStyle.face = 0x000066;
  disabledComboStyle.highlight = 0x000066;
  disabledComboStyle.shadow = 0x000066; 
  disabledComboStyle.highlight3D = 0x000066;
  disabledComboStyle.darkshadow = 0x000066;
  disabledComboStyle.textDisabled = 0xBBBCE8;
  disabledComboStyle.backgroundDisabled = 0x000066;
  disabledComboStyle.foregroundDisabled = 0x000066;

Next, apply the disabledComboStyle whenever the the ComboBox is disabled:

  disabledComboStyle.addListener(phoneComboBox_cb);

This should always happen just before the following line, which occurs in init() and exitEditMode():

  phoneComboBox_cb.setEnabled(false);

Finally, whenever phoneComboBox_cb is enabled, remove the custom style, as follows:

  disabledComboStyle.removeListener(phoneComboBox_cb);

This should always happen just before the following line, which occurs in enterEditMode():

  phoneComboBox_cb.setEnabled(true);