Skip to main content
April 25, 2017
Answered

Disable ctrl+v and Paste function in SWF file

  • April 25, 2017
  • 2 replies
  • 285 views

First of all, its my fiorst post so It might be in a wrong section, my Appologies for that

I am runing a Chat site, its running on html5 and Flash interfaces,
there are some spammers coming and Pasting the same text lines, so I disabled the Paste and ctrl+v function in HTML page, but can someone help me how to disable that on my SWF file !

Thank you for your time

    This topic has been closed for replies.
    Correct answer ClayUUID

    Well that's not ideal.

    Anyway, you could listen for the paste event on your textfield and erase it when that's dispatched. However, that would be terrible UX because it would disable legitimate use of paste like words being moved around within a post, or pasting a URL. A slightly less dreadful solution would be to listen for the change event instead, and only interfere when the difference between the pre-change and post-change text is beyond a certain length threshold, large enough that it wouldn't interfere with most legitimate usage.

    Or best of all, you could blacklist the strings they're pasting, or the IP ranges they're posting from.

    2 replies

    Legend
    April 25, 2017

    If you already have an HTML interface, what's the point of the Flash interface?

    April 25, 2017

    HTML is for mobile users and has not all the functions and Flash is for Desktop users

    ClayUUIDCorrect answer
    Legend
    April 25, 2017

    Well that's not ideal.

    Anyway, you could listen for the paste event on your textfield and erase it when that's dispatched. However, that would be terrible UX because it would disable legitimate use of paste like words being moved around within a post, or pasting a URL. A slightly less dreadful solution would be to listen for the change event instead, and only interfere when the difference between the pre-change and post-change text is beyond a certain length threshold, large enough that it wouldn't interfere with most legitimate usage.

    Or best of all, you could blacklist the strings they're pasting, or the IP ranges they're posting from.

    Jon Fritz
    Community Expert
    Community Expert
    April 25, 2017

    This might be better off over in the Animate (formerly Flash) forum. I'll move it for you...