Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Code snippets can save a lot of time when developing applications and this version of Flash offers several new ones to speed up the development of AIR and Mobile apps. Let's take a look at the Code Snippets window. I'm going to click the icon to open the Code Snippets window. Of course you can just go to Window and Code Snippets as well. In here look toward the bottom and you'll see several folders containing code snippets for mobile and AIR applications. So if I expand the Mobile Touch Events folder, you can see that we can have Tap Event or Touch and Drag Event, Long Press Event.
There is Mobile Gesture so we can do Two Finger Tap, Pinch to Zoom, all of this is very easy to add. You can just select an object and double-click. You'll see swipe gestures move with accelerometer and then support for air code snippets. You can show the Geolocation or Re-orient Object Based on Device Rotation, you can close AIR windows, and you don't have to write this code by hand. So let's just take a look at a quick example of one of these.
Let's say I wanted the skateboard on my screen to move with the rotation of the device. I could select the Skateboarder, open the Code Snippets window in the Mobile Actions folder double-click Move with Accelerometer. Flash automatically adds the code for me. You could see it creates the Accelerometer object, adds the Event Listener for the Accelerometer's update event and creates the function to handle the event. Now if I just wanted them to move left and right, I could comment out that wide line of code, and when I would test this on a device you would see the kid move left and right as I turned my device like a steering wheel.
So that's just one example of the many new code snippets in Flash CS5.5. You can quickly add support for things like gestures and accelerometer data to your applications.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.