title: Capturing the Paste option from the context menu in AS3 Air Application
body: <p>Here is what I am trying to do: </p>
  
  <ol>
  <li><p>User right clicks on a textfield, the system menu that shows the options of "cut,copy,paste,delete,Select All" appears (with only "Paste" and "Select all" active)</p></li>
  <li><p>User clicks on "paste"</p></li>
  <li><p>The pasted text is added to the textfield. </p></li>
  </ol>
  
  <p>My issue is being able to run code <strong>right after</strong> the user selects the "paste" option from the contextmenu. I tried listening to the textfield change, eventchange, to no avail. This is the code I am using. When the above happens, the following code does not fire. "d" is the textfield object</p>
  
  <pre><code>    d.addEventListener(Event.CHANGE, paste);
  
  
      private function paste(e: Event): void {
          trace("paste event fired");
          if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)) {
          trace("pasted data is ", String(Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT)));
          }
      }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I tried the suggestions below, but still no luck. Here is the code I have. "d" is already added to stage</p>
  
  <pre><code>    private function start():void {
             d.addEventListener(TextEvent.PASTE, paste);
      }
      private function paste(event:TextEvent):void{
             trace("something got pasted");
      }
  </code></pre>
  
  <p>What's bugging me is that event is not firing for whatever reason</p>