Skip to main content
Participating Frequently
April 8, 2016
Question

Another inconsistency with Chrome Flash Player 21.0.0.213

  • April 8, 2016
  • 2 replies
  • 794 views

Hello,

Following the recent upgrade of the Chrome Flash Player to 21.0.0.213, I think I have uncovered another unexpected inconsistency. If I have the following paste handler:

protected function application1_pasteHandler(event:Event):void {

  var text : String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;

  label.text = text.replace(/\r/g, "R").replace(/\n/g, "N");

}

to indicate the \n and \r spacial chars in the paste buffer and then paste the buffer "a\nb\r\nc\rd\n" I see "aNbNcdN" in IE and "aNbRNcRdN" in Chrome. This leads me to believe that the IE Flash Player is stripping out the carriage return characters when fetching from the clipboard and Chrome is leaving them intact.

I am testing on Windows with the debug Flash player (21.0.0.213) for both IE and Chrome.

I suspect that the Chrome behaviour has changed in the latest release; however, I guess that this is actually the correct behaviour! Either way, my application is now broken in Chrome.

Is anyone else having similar issues?

Are Adobe aware of this problem?

Thanks,

Justin

    This topic has been closed for replies.

    2 replies

    jeromiec83223024
    Inspiring
    April 12, 2016

    Actually, we changed from PCRE to PCRE2 in the initial Flash Player 21 release.

    PCRE was a little more forgiving in it's interpretation of regular expressions, and I think what you're seeing is that the backspace in \r needs to be escaped.

    If you change the line above to this, you should be good to go:

    text.replace(/\\r/g,"R").replace(/\\n/g,"N");

    Participating Frequently
    April 13, 2016

    I was not clear with my original post. What I am pasting in does not actually contain back slashes but carriage return and new line characters.

    I have removed the misleading regular expressions and confirm that I am getting different behaviour in Chrome and IE:

    protected function application1_pasteHandler(event:Event):void {

      var text : String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;

      var codes : Array = [];

      for (var i : int = 0; i < text.length; i++) {

      codes.push(text.charCodeAt(i));

      }

      foo.text = codes.join(", ");

    }

    Chrome: 97, 10, 98, 13, 10, 99, 13, 100, 10

    IE: 97, 10, 98, 10, 99, 100, 10

    nownitin
    Adobe Employee
    Adobe Employee
    April 13, 2016

    Hello,

    could you please send your clipboard content and sample project for the same problem.

    Thanks,

    Nitin

    _maria_
    Legend
    April 12, 2016