0 Replies Latest reply: Apr 18, 2013 9:12 AM by yu2009 RSS

    Clickboard for Multi-line text

    yu2009 Community Member

      See the code below.  However, when I pasted the text content, the contents are in the same line.  How to solve this problem?  Thanks.

       

      import flash.desktop.Clipboard;

      import flash.desktop.ClipboardFormats;

       

      private var richTextEditor:mx.controls.RichTextEditor = new mx.controls.RichTextEditor();

      ...

      private function button_click():void {

                      richTextEditor.text = txtX.text;

                      richTextEditor.text += '\n' + txtY.text ;

                      richTextEditor.text += '\n' + txtX.text ;

                      richTextEditor.text += '\n' + txtY.text ;

                      System.setClipboard(richTextEditor.text);

      }