Join James Talbot for an in-depth discussion in this video Creating an AIR application in Flash CS5, part of AIR 2 with Flash and Flex Essential Training.
We can create Adobe AIR applications directly from Flash CS5. AIR files can be treated like any other application created using Flash. So, we can use animations, video, ActionScript, and so on. The AIR Application Programming Interface, otherwise known as the API, is fully supported in Flash CS5. We will learn how to use these AIR- specific APIs, which also allow us to do things like access the file system or create a database throughout the rest of this course. When you open up Flash CS5, you'll see you have the option of directly creating a brand-new Adobe AIR application that supports ActionScript 2, and that utilizes the APIs, and includes everything that the Adobe AIR application needs.
You can also take an existing Flash application and convert that into an AIR application. So, here I'll just click on Open, and I'd like you to go to your Getting Started with Flash student files and go to the Begin folder. You'll see a FLA file in here called Publishing_Final. Go ahead and open up your FLA file, and you'll see that this is a very simple little application. It's called TWO TREES OLIVE FARM INTERACTIVE TOUR, and you'll see that this is much more visual than a Flash Builder application.
We can much more easily incorporate artwork and other visual elements. You'll see that the development environment is much more visual as well. So, let's just take a quick look at the application. So, just click Control, choose Test Movie and Test. That should give us a SWF file right now. We can actually just take a look. You can see here, here're some photographs of the olive farm. If I click here, again, just some icons there, and then you also see that again some information about extracting, and some information about bottling the actual Olive Oil.
So, you'll see a very nice little interactive application. If I want to publish this and install this somewhere on a user's machine, or on a kiosk, or something, this could be very useful, and I might use Adobe AIR for that. So, you'll also see that you've taken all the code here. If you look at the Timeline, you'll see, in this case, the code for this application is actually on the animation's movie clip. So if I just double-click here to go into the movie clip here, you'll see that I've added my code directly on the Timeline, which is very different than we've done in Flash Builder.
But you can see the code is very similar. We have our addEventListeners, in this case we're listening for a MouseEvent click, and this is, of course, where you would put your AIR code to create your databases, and do everything that we're going to work with and learn about in the course as we go further along. Now, no, we don't support FXP files directly in Flash CS5 because you would use Flash Catalyst in conjunction with Flash Builder. We're now ready to start learning about how to publish AIR applications.
This course is actually about the Adobe AIR Application Programming Interface, and everything we learn also applies to Flash CS5. The development environment of Flash is very different than Flash Builder, and it takes a much more visual approach.
- Explaining runtime applications
- Installing and using the Adobe AIR 2 SDK
- Compiling a project in Flash Builder
- Packaging an AIR application in Flash Professional
- Converting a Flex project to an AIR project
- Creating application windows
- Moving and copying files across the operating system
- Opening files in default applications
- Displaying HTML content
- Interacting with other AIR applications
- Using the built-in database
- Securing applications