chapter 12

20
Chapter 12 Developing Mobile Applications

Upload: gigi

Post on 24-Feb-2016

31 views

Category:

Documents


0 download

DESCRIPTION

Chapter 12. Developing Mobile Applications. Chapter 12 Lessons. Use the Mobile Content Simulator Repurpose mobile applications Use the Accelerometer Use touch and gesture events. Use the Mobile Content Simulator. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 12

Chapter 12

Developing Mobile Applications

Page 2: Chapter 12

Chapter 12 Lessons

1. Use the Mobile Content Simulator2. Repurpose mobile applications3. Use the Accelerometer4. Use touch and gesture events

Page 3: Chapter 12

Use the Mobile Content Simulator

• Throughout the development process it is important to test the application to determine it is performing as planned.

• Flash provides a new feature in CS6 called the Mobile Content Simulator, which allows you to simulate the use of an application on a mobile device, specifically a smartphone.

Page 4: Chapter 12

Use the Mobile Content Simulator

• The AIR Debug Launcher (Mobile) is used to test a mobile application.

• After selecting the AIR Debug Launcher (Mobile), two windows appear.

• The Content Simulator window is used to simulate the movement of the phone and the actions of the user.

Page 5: Chapter 12

Use the Mobile Content Simulator

Simulator Window

Page 6: Chapter 12

Use the Mobile Content Simulator

The other window that appears is the AIR preview window

Page 7: Chapter 12

Use the Mobile Content Simulator

Information about the file is then displayed in the Output panel.

Page 8: Chapter 12

Repurpose Mobile Applications

• A goal of mobile developers is to be able to create one application and use it for a variety of phones and tablets.

• This reduces development time and allows assets, such as photos, graphics and text to be reused.

Page 9: Chapter 12

Repurpose Mobile Applications

Page 10: Chapter 12

Repurpose Mobile Applications

• While applications can be made scalable, developers need to set an initial target including the device type and operating system.

• The most popular smartphones run the Android operating system or the Apple iOS operating system used on the iPhone.

Page 11: Chapter 12

Use the Mobile Content Simulator

Select this option to have objects on the Stage resize as the Stage dimensions are changed

Page 12: Chapter 12

Use the Mobile Content Simulator

Stage objects scaled as the Stage size is changed

Page 13: Chapter 12

Use the Accelerometer

• When playing games on a mobile device one of the most often used features is having objects move in response to the movement of the device. That is, the user tilts or rotates the device and an object(s) moves.

• The device’s built-in accelerometer controls this movement and ActionScript code in Flash controls the accelerometer.

Page 14: Chapter 12

Code to access the device’s accelerometer

Use the Accelerometer

Page 15: Chapter 12

Code to keep the object on the screen

Use the Accelerometer

Page 16: Chapter 12

• Flash provides several templates for developing mobile applications for Android devices.

• You can use a number of options available in the New from Template dialog box.

Use the Accelerometer

Page 17: Chapter 12

Use the Accelerometer

Page 18: Chapter 12

Use Touch and Gesture Events

You can use the Mobile Content Simulator to test an application that includes Touch and Gesture events, such as drag, swipe, and zoom.

Page 19: Chapter 12

Code snippet for the Swipe to Go to Next/Previous Frame and Stop mobile action

Use Touch and Gesture Events

Page 20: Chapter 12

New from Template dialog box with the Swipe Gallery template selected

Use Touch and Gesture Events