Widget.onPaste

Availability

Flash Player 7 + TheSpringBox 1.1.2

Usage

Widget.onPaste = function(clipboard:String) : Void {
// your statements here
}

Parameters

clipboard - The string from the clipboard.

Returns

Nothing.

Description

Event handler; an event handling function called when a user presse CTRL+v to paste content form the clipboard.

Example

The function below could be used to handle a paste event. Place two input fields componentes on your stage named "inputOne" and "inputTwo".

var restrictStr = "= * ~ , ) ( % $ + ' | _ & ? / : . @ A-Z a-z 0-9 \\20 \\x16 \\^ \\-";
inputOne.restrict = restrictStr;
inputTwo.restrict = restrictStr;

Widget.onPaste = function(clipboard)
{
  var clipWithFocus = inputOne.getFocus();
  var itsInstanceName = clipWithFocus._parent._name;

  if(itsInstanceName == "inputOne" || itsInstanceName == "inputTwo")
  {
    clipWithFocus._parent.text = clipboard;
  }
};