Whenever an action on our ad is initiated by the user, or by the system, an event is called. We're able to add a JavaScript function to a variety of events in our ad, such as taps on buttons, device shakes, and orientation changes.
Events are separated into three groups:
Global Events: These occur for the entire ad
Page Events: These are related to a particular page
Object Events: These are specific to one object on a page
For example, the user shaking the device or the ad finishing the loading is a global event, a page loading or appearing is a page event, and a button being touched would be an object event. You can view the event hierarchy here:
iAd Producer doesn't have an object or template available for sending e-mails or SMS, but the iAd JS framework that powers our iAd has a simple way of presenting the user with an e-mail dialog.
You may remember we briefly touched upon this in Chapter 6, Ad Destinations and Actions, when we added the ability...