Skip to Main Content
Adobe AIR 1.5 Cookbook
book

Adobe AIR 1.5 Cookbook

by Rich Tretola, David Tucker, Marco Casario, Koen DeWeggheleire, Koen De Weggheleire
November 2008
Beginner to intermediate content levelBeginner to intermediate
446 pages
10h 38m
English
O'Reilly Media, Inc.
Content preview from Adobe AIR 1.5 Cookbook

Chapter 7. Clipboard Support

Because support for the clipboard is essential in any desktop application, AIR allows for access to the operating system clipboard in several data formats. AIR also provides support for many operations beyond the standard copying, cutting, and pasting of text within an application. The standard data formats within AIR let you work with many types of text data, bitmap data, and even file references. Another great feature of the clipboard support within AIR is that you can extend it and create your own custom clipboard data format to fit your AIR application.

Working with the Clipboard Data Types

Problem

You need to be able to see whether a specific type of data is present on the operating system clipboard.

Solution

Use the hasFormat method of the ClipboardFormats class to determine whether the desired format is defined by that class.

Discussion

The clipboard is designed to hold multiple types of data simultaneously. It is often prudent to store multiple formats of the same data when you store to the clipboard, because you may not know the preferred format of the application that may later use the clipboard data. AIR gives you the ability to work with the different data formats via many of the methods of the Clipboard class. To begin with, six default clipboard data formats are defined in AIR:

  • ClipboardFormats.TEXT_FORMAT: This format contains simple text data within the clipboard.

  • ClipboardFormats.HTML_FORMAT: This format contains formatted HTML data within the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Breaking Out of the Web Browser with Adobe AIR

Breaking Out of the Web Browser with Adobe AIR

Jeff Tapper, Michael Labriola, Peter Dilillo, Tom Kaczanko, Andriy Kupriyenko, Louie Penaflor, Mike Nimer, Nathan Weber, Steve Zimmers
Adobe AIR Programming Unleashed

Adobe AIR Programming Unleashed

Stacy Tyler Young, Michael Givens, Dimitrios Gianninas

Publisher Resources

ISBN: 9780596156145Supplemental ContentErrata Page