actionscript 3 - flash - getting keyboard focus without clicking -


in actionscript 3 program used code add event listener textfield:

var tf:textfield = new textfield(); tf.addeventlistener(keyboardevent.key_down, handletext); 

handletext() gets called if click on textfield. there way receive keyboard events when mouse hovering on textfield (no need click)?

a textfield has own keyboard event listener uses alter text, if mode input. , capture keyboard events while target not have focus, add listener stage, , check if mouse on text field in question. this, can set boolean flag in mouse_over , drop in mouse_out listener attached textfield. then, if flag on, can either parse keyboard event or transfer textfield via dispatchevent() call existing keyboardevent object.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -