0 Replies Latest reply on Oct 5, 2008 5:34 PM by BudHud

    Paste From Clipboard

    BudHud
      I want to paste from the text from the clipboard into label1. I copied the code here from the tutorial. Everything seems okay. But it doesn’t paste into label1.text. I get the errors: Access of undefined property Clipboard and Access of undefined property Clipboard Formats. See anything wrong?

      <mx:Script>
      <![CDATA[

      import flash.desktop.Clipboard;
      import flash.desktop.ClipboardFormats;

      private var clp:String;

      private function clipit():void
      {
      if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)){
      var clp:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT);
      label1.text = clp;
      }
      }

      ]]>
      </mx:Script>

      <mx:Button y=”231” x=”439” label=”Button3” click=”clipit()”/>

      Thanks,

      BudHud