Streaming Media - December 2007/January 2008 - (Page 62) in Flex, you’ll need to create two separate files: an MXML file, which declaratively defines the application user interface elements, or “chrome,” in an XMLbased language, and an ActionScript file (XML file) that defines client logic and procedural control. You write both MXML and ActionScript source code using the Flex Builder IDE, and then you compile it with the Flex compiler to produce a binary file with an SWF extension. Note that the following code is for AIR beta 2. 1. Click the Flex Builder 3 icon to launch the application. 2. Select File > New > AIR Project. The Create New AIR Project set-up screen opens. 3. In the Project Name text box, enter DragDropVideo and click Next. 4. Leave the default settings and click Finish. Flex Builder creates a new project that includes an MXML file, which contains the application logic, and an XML file, which describes the windows chrome. 5. In the Navigator on the left side, select DragDropVideo.xml. Copy and paste the code available at www.helpexamples.com/flash/ video into the Source view to the right to define the appearance of your application, including windows chrome. 6. Next, select DragDropVideo-app.mxml. In the Source view on the right, copy and paste the code available at www.helpexamples.com/flash/video to define the logic behind your application. 7. Select Project > Export AIR Package. The Adobe AIR Package Contents screen opens. 8. Change the Save as location to your desktop, and leave all other settings in their default state. 9. Click Finish. AIRborne Figure 5. Navigate to the DragDropVideo.air file on your desktop and double-click it to launch the application Installer. Installing and Launching Your Application Built on Adobe AIR Now it’s time to install, launch, and actually use the application. 1. Navigate to the DragDropVideo.air file on your desktop and double-click it to launch the application Installer (see Figure 5). 2. Follow the Installation instructions, selecting the Start application after installation checkbox in the second installation screen (see Figure 6). 3. You’ll see the application window open, with the application title DragDropVideo. 4. Drag and drop the FLV file from your desktop onto the application window. The video begins playing. FIgure 6. Follow the Installation instructions, selecting the Start application after installation checkbox in the second installation screen. Looking Ahead at Developing RIAs and Applications Built on Adobe AIR This article provided a quick tour of Adobe AIR and some of the new tools developers have for packaging web-based applications for the desktop. It also offers a glimpse into the advantages of better integrating video and desktop applications to reach audiences with more engaging, relevant content. 62 STREAMING MEDIA December 2007/January 2008 It is likely that many applications built on Adobe AIR will be developed alongside web-based applications, letting developers extend the reach of their applications to the desktop and giving users rich application experiences—online or offline. Regardless of the approach, the ability to more easily and reliably integrate video into applications opens the door to new revenue paths for businesses, to stronger customer relationships, and to better user experiences. Lee Brimelow is a platform evangelist at Adobe focusing on the Flash, Flex, and AIR development communities. Comments? Email us at letters@streamingmedia.com, or check the masthead for other ways to contact us. http://www.helpexamples.com/flash/video http://www.helpexamples.com/flash/video http://www.helpexamples.com/flash/video
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.