actionscript 3 - Dispatch Paste Event in AS3 -


this as3 code textbox instance name of mytextbox placed on stage -:

import flash.display.*; import flash.events.*;  mytextbox.text = 'hello india'; mytextbox.addeventlistener(event.paste, onpaste)  function onpaste(e:event):void {     trace("lol"); } 

but when paste text text box, nothing happens. can't figure out issue. help...

according documentation http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/events/event.html#paste:

note: textfield objects not dispatch clear, copy, cut, paste, or selectall events. textfield objects include cut, copy, paste, clear, , select commands in context menu. cannot remove these commands context menu textfield objects. textfield objects, selecting these commands (or keyboard equivalents) not generate clear, copy, cut, paste, or selectall events. however, other classes extend interactiveobject class, including components built using flash text engine (fte), dispatch these events in response user actions such keyboard shortcuts , context menus.

so easiest option use tlf textfield. (make sure publish flash player 10)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -