Using our Cloud 9 - iPad
project, we'll add an events page with a button that'll add an event to the user's iPad inbuilt calendar:
1. Open the
Cloud 9 - iPad
projectand add a blank page to your ad. Add a button that goes to this page to the main menu carousel. Go back to Chapter 7, Building for the Big Screen, if you need a reminder on how to do this. Name the pageEvents
. Use the image events-button.png for the button image and place it on one of the placeholder cloud cells, such as Cell 4, as shown in the following screenshot:2. Open the new Events page on the ad canvas and add a button to the canvas from the object library. Change the text in the button to read
Add to calendar
.3. With the button selected, add an
Execute JavaScript
event for when the object isTouched Up Inside
. Delete the placeholder comment and add the following lines of code://Convert readable date into milliseconds var startDate = Date.parse("Tue, 16 Aug 2011 13:30:00 GMT");
4....