setClipboard (System.setClipboard method)
public static setClipboard(text:String) : Void
Replaces the contents of the Clipboard with a specified text string.
Because of security concerns, it is not possible to read the contents of the system
Clipboard. In other words, there is no corresponding
Availability: ActionScript 1.0; Flash Player 7 - SWF files published for Flash Player 6 or later,
playing in Flash Player 7 or later.
Parameters
- A plain-text string of characters to place on the system Clipboard, replacing its
text:String
current contents (if any).
Example
The following example places the phrase
System.setClipboard("Hello world");
The following example creates two text fields at runtime, called
you select text in the
Clipboard. Then you can paste the text into the
this.createTextField("in_txt", this.getNextHighestDepth(), 10, 10, 160,
120);
in_txt.multiline = true;
in_txt.border = true;
in_txt.text = "lorum ipsum...";
this.createTextField("out_txt", this.getNextHighestDepth(), 10, 140, 160,
120);
out_txt.multiline = true;
out_txt.border = true;
out_txt.type = "input";
copy_btn.onRelease = function() {
System.setClipboard(in_txt.text);
Selection.setFocus("out_txt");
};
If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
used in this example.
"Hello World"
field, you can click the
in_txt
MovieClip.getNextHighestDepth()
System.getClipboard()
onto the system Clipboard:
in_txt
to copy the data to the
copy_btn
field.
out_txt
method.
and
. When
out_txt
method, which is
System
1159
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?