Question

I am use flash based live video chat application in my site and someone make text flood in chat . How can I disable paste text in TextBox ?

Was it helpful?

Solution

Off the top of my head, you would have to listen for the KeyboardEvent.KEY_DOWN event, and in your handler, determine if the control key and the "V" keycode are in the event. If so, you would have to invoke "event.preventDefault()". Something like this.

public function stopCopying(event:KeyboardEvent):void
{
    var controlActive:Boolean = event.controlKey;
    // Is the control buttton down?
    if( controlActive )
    {
        //[v keycode = 86][1]
        if( event.keyCode == 86 )
        {
           event.preventDefault();
        }
    }
}

That's pretty much the best I can do off the top of my head, I haven't ever used this in practice.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top