chapter 12
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 PresentationTRANSCRIPT
![Page 1: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/1.jpg)
Chapter 12
Developing Mobile Applications
![Page 2: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/2.jpg)
Chapter 12 Lessons
1. Use the Mobile Content Simulator2. Repurpose mobile applications3. Use the Accelerometer4. Use touch and gesture events
![Page 3: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/3.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/4.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/5.jpg)
Use the Mobile Content Simulator
Simulator Window
![Page 6: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/6.jpg)
Use the Mobile Content Simulator
The other window that appears is the AIR preview window
![Page 7: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/7.jpg)
Use the Mobile Content Simulator
Information about the file is then displayed in the Output panel.
![Page 8: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/8.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/9.jpg)
Repurpose Mobile Applications
![Page 10: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/10.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/11.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/12.jpg)
Use the Mobile Content Simulator
Stage objects scaled as the Stage size is changed
![Page 13: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/13.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/14.jpg)
Code to access the device’s accelerometer
Use the Accelerometer
![Page 15: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/15.jpg)
Code to keep the object on the screen
Use the Accelerometer
![Page 16: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/16.jpg)
• 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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/17.jpg)
Use the Accelerometer
![Page 18: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/18.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/19.jpg)
Code snippet for the Swipe to Go to Next/Previous Frame and Stop mobile action
Use Touch and Gesture Events
![Page 20: Chapter 12](https://reader036.vdocument.in/reader036/viewer/2022062520/56816553550346895dd7ce60/html5/thumbnails/20.jpg)
New from Template dialog box with the Swipe Gallery template selected
Use Touch and Gesture Events