Tip:
Highlight text to annotate it
X
Most modern operating systems use a clipboard to share data between different applications.
This can be simple data such as copied text, bitmap data from an image or a list of files
from the desktop. Every time you copy and paste between applications,
you are using the clipboard. Now before you begin working with the operating
system clipboard inside of AIR, I wanted to demonstrate some key characteristics
of the clipboard. So to do that, the first thing I am going
to do is open up Internet Explorer. Now I have loaded up the lynda.com homepage,
and I will go scroll down and I am going to find this one paragraph
of text. I am going to highlight the paragraph and
I am going to right-click or Control-click on Mac and select Copy.
At this point, you will probably assume that this has just copied just the text,
but as we will learn there are many different kinds of text within the clipboard.
To illustrate this, I have loaded up Microsoft Word 2007.
Let me go to the Paste option and I am going to go down to the Paste Special and it's going
to show us a list of every type of data that's currently on
the clipboard. We can see right here from this one item that
we have highlighted and copied that there is unformatted text
as we might expect, there is also HTML Formatted Text, there is Unformatted Unicode Text and
there is Formatted Text RTF. So simply by highlighting one paragraph and
copying it, we get 4 different data types added to the clipboard.
But it's not just with text. If I clear all the items off the clipboard
and I go back to the web page, I can unselect this text and move to the top
of the page and right-click on the logo and select Copy.
If I go back to Microsoft Word and go to Paste and Paste Special,
you are going to see that there are also different types of data on the clipboard with an image.
There is device-independent bitmap data, which is the actual bitmap data inside of the image.
There is HTML Format Data, which includes the image tag and the reference to the actual
image file itself and then an actual file's object that actually
contains a reference to this specific file. So just again with copying one image, we get
3 different data formats. So there are several things that we need to
learn about the clipboard, but one of the main items to understand
as we move forward and look at AIR support for the clipboard is that clipboard can contain
many different types of data even at the same time, even from a
single originating piece of data. So we are going to move on and look at how
AIR supports the clipboard and we will be working
with the Image Loader application that we viewed earlier.
AIR supports almost every function of the clipboard and it allows
to greatly enhance the functionality of this application.