﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="book" content="ActionScript&nbsp;3.0&nbsp;Language&nbsp;and&nbsp;Components&nbsp;Reference"><link rel="stylesheet" href="../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../override.css" type="text/css"><meta name="keywords" content="Clipboard,flash.desktop.Clipboard,BITMAP_FORMAT,CLONE_ONLY,CLONE_PREFERRED,COPY,CRITICAL,FILE_LIST_FORMAT,HTML_FORMAT,INFORMATIONAL,LINK,MAX_TIP_LENGTH,MOVE,NONE,ORIGINAL_ONLY,ORIGINAL_PREFERRED,RICH_TEXT_FORMAT,TEXT_FORMAT,URL_FORMAT,activeWindow,allowCopy,allowLink,allowMove,applicationDescriptor,applicationID,autoExit,bitmaps,bitmaps,bitmaps,bitmaps,dragInitiator,dropAction,formats,generalClipboard,height,height,height,icon,idleThreshold,isDragging,menu,menu,menu,nativeApplication,openedWindows,publisherID,runtimePatchLevel,runtimeVersion,startAtLogin,supportsDockIcon,supportsMenu,supportsSystemTrayIcon,timeSinceLastUserInput,tooltip,width,width,width,acceptDragDrop,activate,addEventListener,bounce,clearData,clear,clear,copy,cut,dispatchEvent,doDrag,exit,getData,getDefaultApplication,hasFormat,isSetAsDefaultApplication,paste,removeAsDefaultApplication,removeEventListener,selectAll,setAsDefaultApplication,setData,setDataHandler,toString,update"><title>flash.desktop.Clipboard (ActionScript 3.0)</title><script src="../../AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../help.js"></script><script language="javascript" type="text/javascript" src="../../cookies.js"></script><script language="javascript" type="text/javascript">  
            <!--  
			    
				asdocTitle = 'Clipboard - ActionScript 3.0 Language and Components Reference';

				var baseRef = '../../';

				window.onload = configPage;
			      
			    -->  
            </script>
<script language="javascript" type="text/javascript"><!--
function submitValue(){
var searchStr=document.getElementById('search-livedocs').value;
window.location="../../search.html"+"###"+searchStr;
}
--></script><script type="text/javascript">
		scrollToNameAnchor();
	</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">ActionScript 3.0 Language and Components Reference</td><td class="titleTableSearch" align="center"><form class="searchForm" method="get" action="../../search.html" onsubmit="submitValue();"><input class="hidden" name="loc" value="" type="hidden"><input class="hidden" name="termPrefix" value="" type="hidden"><input class="hidden" name="term" value="" type="hidden"><input class="hidden" name="area" value="" type="hidden"><input id="search-livedocs" name="search_text" value="" title="" type="text"> <input type="button" name="action" value="Search" onclick="submitValue()"></form></td><td class="titleTableTopNav" align="right"><a href="../../../../Flash/10.0_Welcome/index.html">Home</a>&nbsp;|&nbsp;<a href="../../package-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="../../class-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../language-elements.html">Language Elements</a>&nbsp;| <a href="../../all-index-Symbols.html" onclick="loadClassListFrame('../../index-list.html')">Index</a>&nbsp;|&nbsp;<a href="../../appendixes.html">Appendixes</a>&nbsp;|&nbsp;<a href="../../conventions.html">Conventions</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../index.html?flash/desktop/Clipboard.html&amp;flash/desktop/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">Clipboard</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a>&nbsp;| <a href="#styleSummary">Styles</a>&nbsp;| <a href="#effectSummary">Effects</a>&nbsp;| <a href="#constantSummary">Constants</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
                
                    
                

				<!--

				
				    
				

					if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Clipboard"); titleBar_setSubNav(false,true,false	,false,false,false,true,true,false	,false,false,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">flash.desktop</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public  class  Clipboard</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Clipboard  <img src="../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="../../Object.html">Object</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p></p>
        The Clipboard class provides a container for transferring data and objects through the clipboard 
 and through drag-and-drop operations (AIR only). The operating system clipboard 
 can be accessed through the static
        <code>generalClipboard</code>
        property.
        <p>
          A Clipboard object can contain the same information in more than one format. 
 By supplying information in multiple formats, you increase the chances that another 
 application will be able to use that information. Add data to a Clipboard object 
 with the
          <code>setData()</code>
          or
          <code>setDataHandler()</code>
          method.
        </p>
        
               <p>The standard formats are:</p>
        
               <ul>
                  <li>BITMAP_FORMAT: a BitmapData object (AIR only)</li>
                  <li>FILE_LIST_FORMAT: an array of File objects (AIR only)</li>
                  <li>HTML_FORMAT: HTML-formatted string data</li>
                  <li>TEXT_FORMAT: string data</li>
                  <li>RICH_TEXT_FORMAT: a ByteArray containing Rich Text Format data</li>
                  <li>URL_FORMAT: a URL string (AIR only)</li>
               </ul>
        
               <p>Constants for these formats are defined in the ClipboardFormats class.</p>
        
               <p>
          When a transfer between Flash Player or an AIR application and the operating system occurs,
 the standard formats are automatically translated between
          
          
          <span>ActionScript</span>
          data types and the native clipboard.
        </p>
        
               <p>
          You can use application-defined formats to add
          
          
          <span>ActionScript</span>
          objects to a 
 Clipboard object. If an object is serializable, both a reference and a clone 
 of the object can be made available. Object references are valid only within the 
 originating application.
        </p>
        
               <p>
          When it is computationally expensive to convert the information to be transferred into a 
 particular format, you can supply the name of a function that performs the conversion. 
 The function is called if and only if that format is read by the receiving component or application. 
 Add a deferred rendering function to a Clipboard object with the
          <code>setDataHandler()</code>
          method.
        </p>
        
               <p>
                  <b>Note for AIR applications:</b>
          The clipboard objects referenced by the event objects dispatched for HTML 
 drag-and-drop and copy-and-paste events are not the same type as the AIR Clipboard object.
 The JavaScript clipboard object is described in the AIR developer's guide.
        </p>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="NativeDragManager.html" target="">flash.desktop.NativeDragManager</a><br/><a href="ClipboardFormats.html" target="">flash.desktop.ClipboardFormats</a><br/><a href="ClipboardTransferMode.html" target="">flash.desktop.ClipboardTransferMode</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th>Defined By</th></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#constructor" class="signatureLink">constructor</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">A reference to the class object or constructor function for a given object instance.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#formats" class="signatureLink">formats</a> : <a href="../../Array.html">Array</a><div class="summaryTableDescription">[read-only] An array of strings containing the names of the data formats available
 in this Clipboard object.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#generalClipboard" class="signatureLink">generalClipboard</a> : <a href="../../flash/desktop/Clipboard.html">Clipboard</a><div class="summaryTableDescription">[static] [read-only] The operating system clipboard.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#prototype" class="signatureLink">prototype</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">[static] A reference to the prototype object of a class or function object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><div class="showHideLinks"><div id="hideInheritedMethod" class="hideInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(false,'Method');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Methods</a></div><div id="showInheritedMethod" class="showInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(true,'Method');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#Clipboard()" class="signatureLink">Clipboard</a>()</div><div class="summaryTableDescription">Creates an empty Clipboard object.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#clear()" class="signatureLink">clear</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Deletes all data representations from this Clipboard object.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#clearData()" class="signatureLink">clearData</a>(format:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Deletes the data representation for the specified format.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getData()" class="signatureLink">getData</a>(format:<a href="../../String.html">String</a>, transferMode:<a href="../../String.html">String</a> = "originalPreferred"):<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Gets the clipboard data if data in the specified format is present.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#hasFormat()" class="signatureLink">hasFormat</a>(format:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks whether data in the specified format exists in this Clipboard object.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#hasOwnProperty()" class="signatureLink">hasOwnProperty</a>(name:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an object has a specified property defined.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#isPrototypeOf()" class="signatureLink">isPrototypeOf</a>(theClass:<a href="../../Object.html">Object</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an instance of the Object class is in the prototype chain of the object specified 
  as the parameter.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#propertyIsEnumerable()" class="signatureLink">propertyIsEnumerable</a>(name:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether the specified property exists and is enumerable.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setData()" class="signatureLink">setData</a>(format:<a href="../../String.html">String</a>, data:<a href="../../Object.html">Object</a>, serializable:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Adds a representation of the information to be transferred in the specified data format.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setDataHandler()" class="signatureLink">setDataHandler</a>(format:<a href="../../String.html">String</a>, handler:<a href="../../Function.html">Function</a>, serializable:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Adds a reference to a handler function that produces the data for the specified format on demand.</div></td><td class="summaryTableOwnerCol">Clipboard</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#setPropertyIsEnumerable()" class="signatureLink">setPropertyIsEnumerable</a>(name:<a href="../../String.html">String</a>, isEnum:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the availability of a dynamic property for loop operations.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#toString()" class="signatureLink">toString</a>():<a href="../../String.html">String</a></div><div class="summaryTableDescription">Returns the string representation of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#valueOf()" class="signatureLink">valueOf</a>():<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Returns the primitive value of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr></table></div><script language="javascript" type="text/javascript"><!--
                      showHideInherited();
                      --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="formats"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">formats</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>formats:<a href="../../Array.html">Array</a></code>&nbsp;&nbsp;[read-only] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>
          An array of strings containing the names of the data formats available
 in this Clipboard object.
          <p>String constants for the names of the standard formats are defined in the
 ClipboardFormats class. Other, application-defined, strings may also be used as format
 names to be transfer data as an object.</p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get formats():<a href="../../Array.html">Array</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="ClipboardFormats.html" target="">flash.desktop.ClipboardFormats</a></div><br/><span class="label"> Example </span><br/><div class="detailBody">
          The following example reads the
          <code>formats</code>
          array of the system clipboard:
          <div class="listing"><pre>var availableFormats:Array = Clipboard.generalClipboard.formats;</pre></div>
        </div></div><a name="propertyDetail"></a><a name="generalClipboard"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">generalClipboard</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>generalClipboard:<a href="../../flash/desktop/Clipboard.html">Clipboard</a></code>&nbsp;&nbsp;[read-only] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>
          The operating system clipboard.
          <p>Any data pasted to the system clipboard is available to other 
  applications. This may include insecure remote code running in
  a web browser.</p>
          
          <p>
            <b>Note:</b>
            In Flash Player 10 applications, a paste operation from the clipboard first
  requires a user event (such as a keyboard shortcut for the Paste command or a mouse click on the Paste command
  in a context menu).
            <code>Clipboard.getData()</code>
            will return the contents of the clipboard only if the InteractiveObject has received
  and is acting on a paste event. Calling
            <code>Clipboard.getData()</code>
            under any other circumstances
  will be unsuccessful. The same restriction applies in AIR for content outside the
  application sandbox.
          </p>
          
          <p>
            The
            <code>generalClipboard</code>
            object is created automatically.
  You cannot assign another instance of a Clipboard to this property.
  Instead, you use the
            <code>getData()</code>
            and
            <code>setData()</code>
            methods to read and write data to the existing object.
          </p>
          
          <p>You should always clear the clipboard before writing new data to it
  to ensure that old data in all formats is erased.</p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get generalClipboard():<a href="../../flash/desktop/Clipboard.html">Clipboard</a></code><br/><br/><span class="label"> Example </span><br/><span class="usage"><a href="../../ExampleInstruct.html"> How to use examples </a></span><br/>
          
        
          
        </div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="Clipboard()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">Clipboard</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function Clipboard()</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p>Creates an empty Clipboard object.</p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/IllegalOperationError.html">IllegalOperationError</a> </code> &mdash; 
              <code>new Clipboard()</code>
              is not supported in Flash Player, since only the operating system clipboard should be used in Flash Player. For copy-and-paste operations involving the operating system clipboard, use the Clipboard.generalClipboard object rather than creating a new Clipboard object. Does not throw an error in an AIR application.
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Clipboard.html#generalClipboard" target="">generalClipboard</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example creates a new clipboard for use with the NativeDragManager
 class.
          <p>
            <b>Note:</b>
            For copy-and-paste operations involving the operating system clipboard, 
 use the
            <code>Clipboard.generalClipboard</code>
            object rather than creating a new clipboard.
          </p>
          
          <div class="listing"><pre>import flash.desktop.Clipboard;
 
 var clipboard:Clipboard = new Clipboard();</pre></div>
        </div></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="clear()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">clear</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function clear():<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>Deletes all data representations from this Clipboard object.</p><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example clears the system clipboard:
          <div class="listing"><pre>Clipboard.generalClipboard.clear();</pre></div>
        </div></div><a name="clearData()"></a><a name="clearData(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">clearData</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function clearData(format:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>Deletes the data representation for the specified format.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">format</span>:<a href="../../String.html">String</a></code> &mdash; The data format to remove.</td></tr></table></p><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example clears any data having the format
          <code>ClipboardFormats.TEXT_FORMAT</code>
          from the system clipboard:
          <div class="listing"><pre>import flash.desktop.ClipboardFormats;
 
 Clipboard.generalClipboard.clearData(ClipboardFormats.TEXT_FORMAT);</pre></div>
        </div></div><a name="getData()"></a><a name="getData(String,String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getData</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getData(format:<a href="../../String.html">String</a>, transferMode:<a href="../../String.html">String</a> = "originalPreferred"):<a href="../../Object.html">Object</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>
          Gets the clipboard data if data in the specified format is present.
 Flash Player requires a user event (such as a key press or mouse click) before using
          <code>getData()</code>
          . Call
          <code>getData()</code>
          within a user initiated paste event handler.
 In AIR, this restriction only applies to content outside of the 
 application security sandbox.
          <p>When a standard data format is accessed, the data is returned as a new 
 object of the corresponding Flash Player or AIR type.</p>
          
          <p>
            When an application-defined format is accessed, the value of the
            <code>transferMode</code>
            parameter determines whether a reference to the original
 object or an anonymous object containing a serialized copy of the original
 object is returned. When an
            <code>originalPreferred</code>
            or
            <code>clonePreferred</code>
            mode is specified, 
 Flash Player or AIR returns the alternate version if the preferred version is not available. 
 When an
            <code>originalOnly</code>
            or
            <code>cloneOnly</code>
            mode is specified, Flash Player or AIR returns
            <code>null</code>
            if the requested version is not available.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">format</span>:<a href="../../String.html">String</a></code> &mdash; The data format to return. The format string can contain one of the standard
 names defined in the ClipboardFormats class, or an application-defined name.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">transferMode</span>:<a href="../../String.html">String</a></code> (default = "<code>originalPreferred</code>")<code></code> &mdash; Specifies whether to return a reference or serialized copy
 when an application-defined data format is accessed. The value must be one
 of the names defined in the ClipboardTransferMode class. This value is
 ignored for the standard data formats.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Object.html">Object</a></code> &mdash; An object of the type corresponding to the data format.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Error.html">Error</a> </code> &mdash; 
              <code>transferMode</code>
              is not one of the names defined in the ClipboardTransferMode class.
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../flash/errors/IllegalOperationError.html">IllegalOperationError</a> </code> &mdash; The Clipboard object requested is no longer in scope (AIR only).</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; Reading from or writing to the clipboard is not permitted in this context. 
 In Flash Player, you can only call this method successfully during the processing of a user event 
 (as in a key press or mouse click). In AIR, this restriction only applies to content outside of the 
 application security sandbox.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Clipboard.html#setData()" target="">setData()</a><br/><a href="ClipboardFormats.html" target="">flash.desktop.ClipboardFormats</a><br/><a href="ClipboardTransferMode.html" target="">flash.desktop.ClipboardTransferMode</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example reads text from the system clipboard, if available:
          <div class="listing"><pre>import flash.desktop.ClipboardFormats;

 var pasteData:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;</pre></div>
        </div></div><a name="hasFormat()"></a><a name="hasFormat(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">hasFormat</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function hasFormat(format:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
          Checks whether data in the specified format exists in this Clipboard object.
          <p>Use the constants in the ClipboardFormats class to check for the 
 presence of data in the standard formats.</p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">format</span>:<a href="../../String.html">String</a></code> &mdash; The format type to check.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Boolean.html">Boolean</a></code> &mdash; 
              <code>true</code>
              , if data in the specified format is present.
            </td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/IllegalOperationError.html">IllegalOperationError</a> </code> &mdash; The Clipboard object requested is no longer in scope (AIR only).</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; Reading from or writing to the clipboard is not permitted in this context.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="ClipboardFormats.html" target="">flash.desktop.ClipboardFormats</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example tests the system clipboard to determine 
 whether text-formatted data is available:
          <div class="listing"><pre>if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)){
    //do something 
}</pre></div>
        </div></div><a name="setData()"></a><a name="setData(String,Object,Boolean)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setData</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function setData(format:<a href="../../String.html">String</a>, data:<a href="../../Object.html">Object</a>, serializable:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>
          Adds a representation of the information to be transferred in the specified data format.
 Flash Player requires a user event (such as a key press or mouse click) before using
          <code>setData()</code>
          .
 In AIR, this restriction only applies to content outside of the 
 application security sandbox.
          <p>Different representations of the same information can be added to the clipboard in 
 different formats, which increases the ability of other components or applications to 
 make use of the available data. 
 For example, in an AIR application, an image could be added as bitmap data for use by image editing applications, 
 as a Bitmap object for use by other AIR applications, and as an encoded PNG file 
 for transfer to the native file system.</p>
          
          <p>The data parameter must be the appropriate data type for the specified format:</p>
          
          <table class="innertable" ><tr><th>Format</th><th>Type</th><th>Description</th></tr><tr><td>
                    <code>ClipboardFormats.TEXT_FORMAT</code>
                  </td><td>
                    <code>String</code>
                  </td><td>string data</td></tr><tr><td>
                    <code>ClipboardFormats.HTML_FORMAT</code>
                  </td><td>
                    <code>String</code>
                  </td><td>HTML string data</td></tr><tr><td>
                    <code>ClipboardFormats.URL_FORMAT</code>
                  </td><td>
                    <code>String</code>
                  </td><td>URL string (AIR only)</td></tr><tr><td>
                    <code>ClipboardFormats.RICH_TEXT_FORMAT</code>
                  </td><td>
                    <code>ByteArray</code>
                  </td><td>Rich Text Format data</td></tr><tr><td>
                    <code>ClipboardFormats.BITMAP_FORMAT</code>
                  </td><td>
                    <code>BitmapData</code>
                  </td><td>bitmap data (AIR only)</td></tr><tr><td>
                    <code>ClipboardFormats.FILE_LIST_FORMAT</code>
                  </td><td>
                    array of
                    <code>File</code>
                  </td><td>an array of files (AIR only)</td></tr><tr><td>Custom format name</td><td>any</td><td>object reference and serialized clone</td></tr></table>
          
          <p>Custom format names cannot begin with "air:" or "flash:". In an AIR application, to prevent name collisions
 when using custom formats, you may want to use your application ID or a package name as a
 prefix to the format, such as "com.example.applicationName.dataPacket".</p>
          
          <p>
            When transferring within or between Flash Player or AIR applications, the
            <code>serializable</code>
            parameter 
 determines whether both a reference and a copy are available, or whether only a reference to 
 an object is available. Set
            <code>serializable</code>
            to
            <code>true</code>
            to make both the reference 
 and a copy of the data object available. Set
            <code>serializable</code>
            to
            <code>false</code>
            to make only the object reference available. Object references are valid only within the current 
 application so setting
            <code>serializable</code>
            to
            <code>false</code>
            also means that the data
 in that format is not available to other Flash Player or AIR applications. A component can choose to get 
 the reference or the copy of the object by setting the appropriate clipboard transfer mode 
 when accessing the data for that format.
          </p>
          
          <p>
            <b>Note:</b>
            The standard formats are always converted to native formats when data is pasted or
 dragged (AIR only) outside a supported application, so the value of the
            <code>serializable</code>
            parameter does not affect the availability of data in the standard formats to non-Flash Player or non-AIR applications.
          </p>
          
          <p>
            To defer rendering of the data for a format, use the
            <code>setDataHandler()</code>
            method instead.
 If both the
            <code>setData()</code>
            and the
            <code>setDataHandler()</code>
            methods are used to add a
 data representation with the same format name, then the handler function will never be called.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">format</span>:<a href="../../String.html">String</a></code> &mdash; The information to add.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">data</span>:<a href="../../Object.html">Object</a></code> &mdash; The format of the data.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">serializable</span>:<a href="../../Boolean.html">Boolean</a></code> (default = <code>true</code>)<code></code> &mdash; 
              Specify
              <code>true</code>
              for objects that can be serialized (and deserialized).
            </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Boolean.html">Boolean</a></code> &mdash; 
              <code>true</code>
              if the data was succesfully set;
              <code>false</code>
              otherwise. In Flash Player, returns
              <code>false</code>
              when
              <code>format</code>
              is an
 unsupported member of ClipboardFormats. (Flash Player does not support
              <code>ClipboardFormats.URL_FORMAT</code>
              ,
              <code>ClipboardFormats.FILE_LIST_FORMAT</code>
              , or
              <code>ClipboardFormats.BITMAP_FORMAT</code>
              ).
            </td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/IllegalOperationError.html">IllegalOperationError</a> </code> &mdash; The Clipboard object requested is no longer in scope (AIR only).</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; Reading from or writing to the clipboard is not permitted in this context.
 In Flash Player, you can only call this method successfully during the processing of a user event 
 (as in a key press or mouse click). In AIR, this restriction only applies to content outside of the 
 application security sandbox.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../TypeError.html">TypeError</a> </code> &mdash; 
              <code>format</code>
              or
              <code>data</code>
              is
              <code>null</code>
              .
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Clipboard.html#setDataHandler()" target="">setDataHandler()</a><br/><a href="Clipboard.html#getData()" target="">getData()</a><br/><a href="ClipboardFormats.html" target="">flash.desktop.ClipboardFormats</a><br/><a href="ClipboardTransferMode.html" target="">flash.desktop.ClipboardTransferMode</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example adds content to the system clipboard in both 
 text and HTML formats:
          <div class="listing"><pre>import flash.desktop.ClipboardFormats;
 
 var htmlString:String = "&lt;html&gt;&lt;body&gt;Body content&lt;/body&gt;&lt;/html&gt;";
 Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, urlString);
 Clipboard.generalClipboard.setData(ClipboardFormats.HTML_FORMAT, urlString);</pre></div>
        </div></div><a name="setDataHandler()"></a><a name="setDataHandler(String,Function,Boolean)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setDataHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function setDataHandler(format:<a href="../../String.html">String</a>, handler:<a href="../../Function.html">Function</a>, serializable:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.0</td></tr></table><p></p><p></p><p>
          Adds a reference to a handler function that produces the data for the specified format on demand.
 Use this method to defer creation or rendering of the data until it is actually accessed.
 Flash Player requires a user event (such as a key press or mouse click) before using
          <code>setDataHandler()</code>
          .
 In AIR, this restriction only applies to content outside of the 
 application security sandbox.
          <p>The handler function must return the appropriate data type for the specified format:</p>
          
          <table class="innertable" ><tr><th>Format</th><th>Return Type</th></tr><tr><td>
                    <code>ClipboardFormats.TEXT_FORMAT</code>
                  </td><td>
                    <code>String</code>
                  </td></tr><tr><td>
                    <code>ClipboardFormats.HTML_FORMAT</code>
                  </td><td>
                    <code>String</code>
                  </td></tr><tr><td>
                    <code>ClipboardFormats.URL_FORMAT</code>
                  </td><td>
                    <code>String</code>
                    (AIR only)
                  </td></tr><tr><td>
                    <code>ClipboardFormats.RICH_TEXT_FORMAT</code>
                  </td><td>
                    <code>ByteArray</code>
                  </td></tr><tr><td>
                    <code>ClipboardFormats.BITMAP_FORMAT</code>
                  </td><td>
                    <code>BitmapData</code>
                    (AIR only)
                  </td></tr><tr><td>
                    <code>ClipboardFormats.FILE_LIST_FORMAT</code>
                  </td><td>
                    Array of
                    <code>File</code>
                    (AIR only)
                  </td></tr><tr><td>Custom format name</td><td>Non-void</td></tr></table>
          
          <p>The handler function is called when and only when the data in the specified format is read. 
 Note that the underlying data can change between time the handler is added and the time the data is
 read unless your application takes steps to protect the data. 
 The behavior that occurs when data on the clipboard represented by a handler function is read more than once 
  is not guaranteed. Flash Player or AIR might return the data produced by the first function call or it might call the 
  function again. Do not rely on either behavior.</p>
          
          <p>
            To add data directly to this Clipboard object, use the
            <code>setData()</code>
            method instead.     
 If both the
            <code>setData()</code>
            and the
            <code>setDataHandler()</code>
            methods are called with the same
 format name, then the handler function is never be called.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">format</span>:<a href="../../String.html">String</a></code> &mdash; A function that returns the data to be transferred when called.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">handler</span>:<a href="../../Function.html">Function</a></code> &mdash; The format of the data.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">serializable</span>:<a href="../../Boolean.html">Boolean</a></code> (default = <code>true</code>)<code></code> &mdash; 
              Specify
              <code>true</code>
              if the object returned by
              <code>handler</code>
              can be serialized (and deserialized).
            </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Boolean.html">Boolean</a></code> &mdash; 
              <code>true</code>
              if the handler was succesfully set;
              <code>false</code>
              otherwise.
            </td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../TypeError.html">TypeError</a> </code> &mdash; 
              <code>format</code>
              or
              <code>handler</code>
              is
              <code>null</code>
              .
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../flash/errors/IllegalOperationError.html">IllegalOperationError</a> </code> &mdash; The Clipboard object requested is no longer in scope (AIR only).</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; Reading from or writing to the clipboard is not permitted in this context.
 In Flash Player, you can only call this method successfully during the processing of a user event 
 (such as a key press or mouse click). In AIR, this restriction only applies to content outside of the 
 application security sandbox.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Clipboard.html#setData()" target="">setData()</a><br/><a href="ClipboardFormats.html" target="">flash.desktop.ClipboardFormats</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example adds a random number to the system clipboard  
 through a deferred data function:
          <div class="listing"><pre>import flash.desktop.ClipboardFormats;
 
 Clipboard.generalClipboard.setDataHandler(ClipboardFormats.TEXT_FORMAT, randomNumberGenerator);

 public function randomNumberGenerator():String{
     return Math.random().toString();
 }</pre></div>
        </div></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples<span class="usage"><a href="../../ExampleInstruct.html"> How to use examples </a></span></div><div class="exampleHeader">ClipboardExample.as</div><br/><div class="detailBody">
        The following example uses the ClipboardExample class to 
 copy a string from one variable to another via the system clipboard.  
 This task is accomplished by performing the following steps:
        <ol><li>
            Write the data, in this case a string, to
            <code>Clipboard.generalClipboard</code>
            .
          </li><li>
            Read the clipboard contents from
            <code>Clipboard.generalClipboard</code>
            .
          </li></ol>
        
        <div class="listing"><pre>package
{
    import flash.display.Sprite;
    import flash.desktop.Clipboard;
    import flash.desktop.ClipboardFormats;
    import flash.desktop.ClipboardTransferMode;

    public class ClipboardExample extends Sprite
    {
        public function ClipboardExample()
        {
            var sally:String = "Sally";
            var person:String;
            
            copy(sally);
            person = paste();
            trace(person); //traces: "Sally"
        }

        private function copy(text:String):void{
            Clipboard.generalClipboard.clear();
            Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, text);
        }
        
        private function paste():String{
            if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)){
                return String(Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT));
            } else {return null;}
        }
        
    }
}</pre></div>
      </div><br/><br/><hr><br/><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  </center><div style="display:none">Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard Clipboard </div><div style="display:none">flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard flash.desktop.Clipboard </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
