O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required