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.
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 ...