Chapter 35. Drag and Drop in AIR
In the previous chapter, you learned all about drag and drop within a Flex application running inside a web browser. This chapter introduces you to the drag and drop functionality offered within Adobe AIR running on the desktop. In addition to the functionality offered in a traditional Flex-based application, like dragging data between Flex components, AIR offers the ability to drag to and from the operating system or external applications, including other AIR applications.
A developer, with AIR, could drag data from an AIR application into Microsoft Excel, drag photos from the user's desktop into an AIR application, drag links to a web browser, and so forth. Developers are limited by their imagination and by the native clipboard support of their chosen operating system and destination application.
In this chapter, you're going to learn about the Clipboard
class and types of data it supports, which is essential for understanding what can be done with drag and drop. Then we'll cover everything you need to know about the NativeDragManager
and its events. Finally, we'll finish off with a sample application for dragging images of various formats to and from an AIR application.
Overview of AIR Drag and Drop
To get data to and from AIR applications, AIR uses a Clipboard
object found in flash.desktop.Clipboard
package to transport the data. This is because the operating system's native clipboard is used to make the actual transfer of data to and from AIR. Another ...
Get Professional Adobe® Flex® 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.